More than 8 virtualhosts

Web hosting, MySQL, PHP and all that good stuff.

Moderator: Lillian.W@AST

Post Reply
Mechano
Posts: 25
youtube meble na wymiar Warszawa
Joined: Wed Mar 12, 2014 7:34 am

More than 8 virtualhosts

Post by Mechano »

I've discovered the web interface permits only 8 virtual hosts.
If you want to add more you have to use shell and vi text editor.

Go to sites-available directory of Apache. Copy one of the file vhost_firsthostname_80 to vhost_secondhostname_80 and edit inside the new created file your desired hostname and directory:

Code: Select all

 cd /volume0/usr/builtin/etc/apache2/sites-available
 cp vhost_firsthostname_80  vhost_secondhostname_80
 vi vhost_secondhostname_80
You'll find this entries, change with your hostname and directory:

Code: Select all

<VirtualHost *:80>
    ServerName yourhostname.com <- CHANGE THIS
    DocumentRoot "/volume1/Web/yourhostname" <- CHANGE THIS
    ScriptAlias /cgi-bin/ "/volume1/Web/cgi-bin"
    SSLEngine Off

    <Directory "/volume1/Web/yourhostname"> <- CHANGE THIS
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order Allow,Deny
        Allow from all
    </Directory>
</VirtualHost>
Save the file.
Move to sites-enabled and link the new virtual host, after that restart Apache:

Code: Select all

 cd /volume0/usr/builtin/etc/apache2/sites-enabled
 ln -s ../sites-available/vhost_secondhostname_80 .

 /volume0/usr/builtin/etc/init.d/S54apache2 restart
Post Reply

Return to “Web Hosting”