Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

Name-Based Virtual hosts

I am running wordpress and joomla here.

site1 contain joomla and site2 contains wordpress setup.

When i have this setup the sites are not working properly.  If i just keep site1 and comment out site2 and site3 it works fine. as soon i uncomment site2 or site3 ,   site1 is having issue. they all are in diff directories. Please advise.




NameVirtualHost *:80

<VirtualHost *:80>
        DocumentRoot /var/www/site1
        ServerName www.site1.ca
</VirtualHost>

#<VirtualHost *:80>
#       DocumentRoot /var/www/site2
#       ServerName www.site2.ca
#</VirtualHost>


<VirtualHost *:80>
        DocumentRoot /var/www/site3
        ServerName www.site3.net
</VirtualHost>
0
ittechlab
Asked:
ittechlab
1 Solution
 
arober11Commented:
Do the other virtual hosts work as expected, when uncommented?

Anyway first tweak, add a ServerAlias entry to each virtual host, to see if your loosing the www.  e.g.
ServerAlias    site1.ca   *.site1.ca

If still broke compare the hostname configured for your Joomla site, with the virtual host name, and possibly try something a bit more generic e.g. http://docs.joomla.org/VirtualHost_with_Joomla
0
 
nam0aCommented:
i have following working conf in my computer

make apache listen to particular IP (just a checkpoint)


NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
    DocumentRoot "D:/xampp packages/xampp153/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost 127.0.0.1>
    DocumentRoot "D:/xampp packages/xampp153/htdocs"
    ServerName home
</VirtualHost>

<VirtualHost 127.0.0.1>
    ServerAdmin abc@abc.com
    DocumentRoot "D:/xampp packages/xampp153/htdocs/abc"
    ServerName www.abc.com
    ErrorLog logs/www.abc.com-error.log
    CustomLog logs/www.abc.com-custom.log common
</VirtualHost>

<VirtualHost 127.0.0.1>
    ServerAdmin abc@abc.com
    DocumentRoot "D:/xampp packages/xampp153/htdocs/abc"
    ServerName abc.com
    ErrorLog logs/abc.com-error.log
    CustomLog logs/abc.com-custom.log common
</VirtualHost>
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Tackle projects and never again get stuck behind a technical roadblock.
Join Now