[HOW TO] More than 8 Virtualhosts

Share your awesome tips and tricks here.

Moderator: Lillian.W@AST

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

[HOW TO] 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 to 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
User avatar
WOODY@AST
Posts: 101
Joined: Tue Jun 19, 2012 11:51 pm
Contact:

Re: [HOW TO] More than 8 Virtualhosts

Post by WOODY@AST »

Hi Mechano,
Thanks for your information!!! ;)
Storage: AS5104T
USB Speaker: Logitech Z105
Network: BUFFALO WZR-HP-G450H & Netgear R7500
Laptop: Apple MACBOOk AIR: OS X Mountain Lion & Windows 7 64-bit Ultimate
Media Player: ASUSTOR NAS with KODI
Portable: The NEW HTC ONE & Sony Xperia Z3, iPhone 3GS & iPad
Post Reply

Return to “Tips & Tricks”