how to setup domain via SSH

Discussion in 'Site & Server Administration' started by alexo, Jun 5, 2007.

Thread Status:
Not open for further replies.
  1. #1
    hello

    i have dedicated server [ Debian/linux/ ], where isn't installed any control panel.

    i'm using this server for my primary domain, but now decide to move to this server on of my domains too.

    unfortunately, before this i "add domains" only via control panel, but as i know i can do it via SSH too (w/o any control panel).

    can u give me any advice or give me url of tutorial with guide how to do it step by step.

    i have experience of work via SSH, so knowing how to do, i'm sure i can do it myself.

    thank you
     
    alexo, Jun 5, 2007 IP
  2. Etherfast

    Etherfast Peon

    Messages:
    1,192
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hey there,

    First of all you need to locate your httpd.conf. Most likely, you'll find it in /etc/httpd/conf/httpd.conf.
    slocate httpd.conf
    Code (markup):
    At the bottom of the file, append the following code sequence, changing it to suit your needs.

    
    NameVirtualHost YOUR_VHOST_IP:80
    <VirtualHost YOUR_VHOST_IP:80>
    ServerAdmin YOUR_EMAIL_ADDRESS@domain.com
    DocumentRoot /path/to/document/files/of/your/vhost
    ServerName DOMAINNAME.com
    ServerAlias www.DOMAINNAME.com
    ErrorLog /path/to/logs/domainname.com-error_log
    CustomLog /path/to/logs/domainnamecom-access_log common
    </VirtualHost>
    
    Code (markup):
    Save your file and restart Apache.
    service httpd restart
    Code (markup):
    It should be OK then ;)
    Good luck.
     
    Etherfast, Jun 5, 2007 IP
  3. alexo

    alexo Well-Known Member

    Messages:
    372
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #3
    hello Etherfast

    find my httpd.conf file here /etc/apache2/httpd.conf

    but it was empty file !!!
    is it possible?

    btw, as i said i have primary domain which work on this server.

    thank you
     
    alexo, Jun 5, 2007 IP
  4. Etherfast

    Etherfast Peon

    Messages:
    1,192
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Let's have a look. Please paste the output of "slocate httpd.conf" first.
     
    Etherfast, Jun 5, 2007 IP
  5. alexo

    alexo Well-Known Member

    Messages:
    372
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #5
    here is output of locate httpd.conf

    /etc/apache2/httpd.conf
    /etc/apache2/httpd.conf.save
    /usr/share/doc/apache2.2-common/examples/apache2/original/httpd.conf.gz
    Code (markup):
     
    alexo, Jun 5, 2007 IP
  6. Etherfast

    Etherfast Peon

    Messages:
    1,192
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Great.
    Have a look at this.

    Was useful to a friend once.
    Good luck,
     
    Etherfast, Jun 5, 2007 IP
  7. alexo

    alexo Well-Known Member

    Messages:
    372
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #7
    Etherfast thanks

    one question

    as i said i have 1 domain setuped on this server. if i try to do as in writen in this tutorial, i must change whole settings for server? right ?
     
    alexo, Jun 5, 2007 IP
  8. Etherfast

    Etherfast Peon

    Messages:
    1,192
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I'm not sure on what you're referring to. The already existent domain has its own settings in those files you're editing. Whatever you add to the configuration files has to be APPENDED to them, without changing whatever instructions already exist.

    Have fun,
     
    Etherfast, Jun 5, 2007 IP
  9. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You need these things if anything is missing:

    1. Apache
    2. DNS server
    3. FTP server
    4. mail server
    5. mySQL server
    6. POP server and IMAP server
    7. Patience:)

    The DC might have been installed them for you but running with well isnt easy without a Control Panel.
     
    inworx, Jun 6, 2007 IP
  10. alexo

    alexo Well-Known Member

    Messages:
    372
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #10
    hello inworx

    as my previouse hoster is the worst hoster i even have seen (2 weeks ago, they sold their company to another guy), they install only apache2 :)

    mysql server, php 5 version i install myself.
    do ifconfig (setup ip-s), and crontab.

    >>2. DNS server
    order managed dns server from my registrar.

    so my primary domain (which is private one) work well.

    what i need, is to add new domain to my account. IMHO Etherfast's tutorial is the best in my choice, the only think i'm a little afraid to do something wrong.
     
    alexo, Jun 6, 2007 IP
  11. inworx

    inworx Peon

    Messages:
    4,860
    Likes Received:
    201
    Best Answers:
    0
    Trophy Points:
    0
    #11
    What about ftp? Wont you upload files? or wget is fine for you?
     
    inworx, Jun 7, 2007 IP
  12. alexo

    alexo Well-Known Member

    Messages:
    372
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #12
    first of all ssh is fine for me
    2-nd i have winscp (soft like putty), which allow me to ftp files
     
    alexo, Jun 7, 2007 IP
Thread Status:
Not open for further replies.