It is currently Tue Jan 26, 2021 11:12 am
All times are UTC + 8 hours

[HOW TO] More than 8 Virtualhosts

Share your awesome tips and tricks here.

[HOW TO] More than 8 Virtualhosts

Postby Mechano » Fri Mar 14, 2014 5:03 pm

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

Re: [HOW TO] More than 8 Virtualhosts

Postby WOODY@AST » Fri Mar 21, 2014 9:16 pm

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

Return to Tips & Tricks

  • 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 2 guests

cron