It is currently Thu Jan 21, 2021 12:46 am
All times are UTC + 8 hours

More than 8 virtualhosts

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

More than 8 virtualhosts

Postby Mechano » Wed Mar 12, 2014 9:44 am

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
Mechano
 
Posts: 25
Joined: Wed Mar 12, 2014 7:34 am

Return to Web Hosting

  • You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot post attachments in this forum
  • Who is online

    Users browsing this forum: No registered users and 1 guest