recently company I work for has rented VPS.
Now i need to have multiple websites hosted on this VPS, that is not a problem, I'v set up virtual hosts, databses, etc. Now i wanted to test it, see if I could access website on the VPS by domain name (bennyben.cz). Domain is registered at different registrar, I've pointed DNS A record to IP address of VPS (193.105.159.72) and it works fine (displays apache default site), but i need to route this domain name (bennyben.cz) to virtual host on the VPS (bennyben.cz.vhost).
After some googling, I thought that I needed to add new primary DNS zone record (i have ISPConfig installed on VPS) and direct it to virtual host, so i binded the virtual host to local IP address (192.168.1.1) and set A record on VPS to this address, but if i type the domain name, it still serves the default site.
So my question is, what do i need to host multiple websites with domain names on one VPS (only one WAN IP address available), i did a lot of googling, messed around with BIND, but nothing seems to work.
System details
Ubuntu 13.04
ISPConfig
1 WAN IP address
P.S. I'm sure this is pretty basic stuff, but I work there as a programmer, so servers aren't my specialization, but, unfortunately we currently do not have anybody who could take care of the VPS, so it has fallen to me.
Listen 80
is present in /etc/apache2/ports.conf
**The vhosts config files are generated for me by ISPconfig*
Configuration files: /etc/apache2/sites-enabled/100-bennyben.cz.vhost
<Directory /var/www/bennyben.cz>
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<VirtualHost *:80>
DocumentRoot /var/www/bennyben.cz/web
ServerName bennyben.cz
ServerAlias www.bennyben.cz
ServerAdmin [email protected]
ErrorLog /var/log/ispconfig/httpd/bennyben.cz/error.log
Alias /error/ "/var/www/bennyben.cz/web/error/"
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 502 /error/502.html
ErrorDocument 503 /error/503.html
<IfModule mod_ssl.c>
</IfModule>
<Directory /var/www/bennyben.cz/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client4/web5/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# suexec enabled
<IfModule mod_suexec.c>
SuexecUserGroup web5 client4
</IfModule>
# Clear PHP settings of this website
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
# php as fast-cgi enabled
# For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
<IfModule mod_fcgid.c>
FcgidIdleTimeout 300
FcgidProcessLifeTime 3600
# FcgidMaxProcesses 1000
FcgidMaxRequestsPerProcess 5000
FcgidMinProcessesPerClass 0
FcgidMaxProcessesPerClass 100
FcgidConnectTimeout 3
FcgidIOTimeout 360
FcgidBusyTimeout 300
FcgidMaxRequestLen 1073741824
</IfModule>
<Directory /var/www/bennyben.cz/web>
AddHandler fcgid-script .php .php3 .php4 .php5
FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client4/web5/web>
AddHandler fcgid-script .php .php3 .php4 .php5
FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# add support for apache mpm_itk
<IfModule mpm_itk_module>
AssignUserId web5 client4
</IfModule>
<IfModule mod_dav_fs.c>
# Do not execute PHP files in webdav directory
<Directory /var/www/clients/client4/web5/webdav>
<ifModule mod_security2.c>
SecRuleRemoveById 960015
SecRuleRemoveById 960032
</ifModule>
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
</Directory>
DavLockDB /var/www/clients/client4/web5/tmp/DavLock
# DO NOT REMOVE THE COMMENTS!
# IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
# WEBDAV BEGIN
# WEBDAV END
</IfModule>
</VirtualHost>
/etc/apach2/sites-available/bennyben.cz.vhost
<Directory /var/www/bennyben.cz>
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<VirtualHost *:80>
DocumentRoot /var/www/bennyben.cz/web
ServerName bennyben.cz
ServerAlias www.bennyben.cz
ServerAdmin [email protected]
ErrorLog /var/log/ispconfig/httpd/bennyben.cz/error.log
Alias /error/ "/var/www/bennyben.cz/web/error/"
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 502 /error/502.html
ErrorDocument 503 /error/503.html
<IfModule mod_ssl.c>
</IfModule>
<Directory /var/www/bennyben.cz/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client4/web5/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# suexec enabled
<IfModule mod_suexec.c>
SuexecUserGroup web5 client4
</IfModule>
# Clear PHP settings of this website
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
# php as fast-cgi enabled
# For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
<IfModule mod_fcgid.c>
FcgidIdleTimeout 300
FcgidProcessLifeTime 3600
# FcgidMaxProcesses 1000
FcgidMaxRequestsPerProcess 5000
FcgidMinProcessesPerClass 0
FcgidMaxProcessesPerClass 100
FcgidConnectTimeout 3
FcgidIOTimeout 360
FcgidBusyTimeout 300
FcgidMaxRequestLen 1073741824
</IfModule>
<Directory /var/www/bennyben.cz/web>
AddHandler fcgid-script .php .php3 .php4 .php5
FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client4/web5/web>
AddHandler fcgid-script .php .php3 .php4 .php5
FCGIWrapper /var/www/php-fcgi-scripts/web5/.php-fcgi-starter .php
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# add support for apache mpm_itk
<IfModule mpm_itk_module>
AssignUserId web5 client4
</IfModule>
<IfModule mod_dav_fs.c>
# Do not execute PHP files in webdav directory
<Directory /var/www/clients/client4/web5/webdav>
<ifModule mod_security2.c>
SecRuleRemoveById 960015
SecRuleRemoveById 960032
</ifModule>
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
</Directory>
DavLockDB /var/www/clients/client4/web5/tmp/DavLock
# DO NOT REMOVE THE COMMENTS!
# IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
# WEBDAV BEGIN
# WEBDAV END
</IfModule>
</VirtualHost>