You are here
I'm currently running the Joomla1.6 app "TurnKey Linux 11.2 / Ubuntu 10.04 Lucid LTS"
I would like to run more than one Joomla based site on this server. They would not be sharing the same database, or anything of that nature. Separate directories, separate databases, and the possibility of different Joomla versions on each site. (So, no upgrading all sites at once.)
In looking at the Apache config, I would have thought that it would be as "simple" as creating a new virtual server, and telling it to answer HTTP's for www.domain2.com and look to /var/www/fakenewdir for the files. Is there something I'm missing? In the virtual server details, wouldn't you just change the "Address" field to the new domain (in this example www.domain2.com)? I'm guessing I'd need to change the one that is currently pointing to "/var/www/joomla/" to the actual domain of the current website, versus the "Any" right?
Anyone?
Anyone?
You might get a better (more
You might get a better (more definitive) answer from the Joomla community than the TKL community, but I'll give it a go.
I haven't played with Joomla for a while, but I think you can:
There may be a few other gotchas but I think you have the right idea and have started down this path. Have you tried this to see what happens?
Step #3
It's the step 3 that's throwing things for a loop.
I've set the site for ---
Handles the name-based server on address dev.secondsite.tld.
Port 80
Document Root /var/www/secondsite
The default configuration is left in place....
Handles the name-based server on address *.
Port 80
Document Root /var/www/joomla/
However, any requests that come in will go to the default site associated with /var/www/joomla.
I know I would have tested by modifying my local hosts file (Vista) and can't recall if I tried with DNS modified or not.
Was there something more than the above I needed to do? I would have thought the above config would work.
I'm not sure,
I'm not sure, but...
I'll try this out a little later today and post back my results.
An update...
In order to test this, I just created a second site in my apache configuration and pointed it at a new directory containing just in index.html file.
Presumably, I could copy in the joomla files, create a second database in mysql, and change the configuration.php settings and have things working. I didn't got that far in this test
Here is what I did
After doing that, http://site2 brought me to my new site and anything else showed joomla.
For reference, here is my /etc/apache2/sites-available/site file
Thank you...
I'll give it another test tonight (or this weekend.)
Let us know..
That should do what you need but please post back as to your success/failure.
Still routing to the main
Still routing to the main server. Copied are the two files from /etc/apache2/sites-available - If I've missed something simple, please let me know. (Restarted Apache2 many, many times, so didn't forget that.)
'joomla'
NameVirtualHost dev.thedisplayfinder.com:80
NameVirtualHost *:443
<Directory /var/www/joomla/>
Options +FollowSymLinks
AllowOverride All
order allow,deny
allow from all
</Directory>
site2 file
NameVirtualHost site2.thedisplayfinder.com:80
NameVirtualHost site2.thedisplayfinder.com:443
<VirtualHost *:80>
ServerName site2
UseCanonicalName Off
ServerAdmin webmaster@localhost
DocumentRoot /var/www/site2/
<Directory "/var/www/site2/">
</Directory>
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
ServerName site2
SSLCertificateFile /etc/ssl/certs/cert.pem
ServerAdmin webmaster@localhost
DocumentRoot /var/www/site2/
</VirtualHost>
<Directory /var/www/site2/>
Options +FollowSymLinks
AllowOverride All
order allow,deny
allow from all
</Directory>
ls -alF of /etc/apache2/sites-enabled
site2 -> ../sites-available/site2
ls -alF of /var/www/site2/
6 Sep 16 03:13 index.html
Here are my two
Here are my two files:
/etc/apache2/sites-available/joomla (I did not modify this at all)
/etc/apache2/sites-available/site2
I guess it's not meant to be.
I guess it's not meant to be. I've got to be missing something so incredibly simple it's not even funny. However, I can't seem to figure out what it is. I duplicated your files ... still get directed to the main site.
Thanks for the help. It's appreciated.
You need to restart apache to apply changes
Did you do that?
It's pretty easy:
Yep.
Restarted Apache many times in the process.
Thought you may have...
...but just in case... Sorry I couldn't be more helpful :(
Are you accessing the site with the fqdn?
Are you accessing your site with the site2 url? You need to write your client's host file to point to the appliance id and access with the ServerName url in order to get to the second site.
You could also check if there's a .htaccess file rewriting url's to the first site, and last, check the DB of joomla which probably will need to update a value with the site's url (at least wordpress needs this).
Just some ideas reading quickly your post.
Thank you, Adrian!
Adrain,
Thank you. I think I've got it working.
This is what I had in place ...
<VirtualHost *:80>
ServerName site2
UseCanonicalName Off
ServerAdmin webmaster@localhost
DocumentRoot /var/www/site2/
</VirtualHost>
I changed it to this ...
<VirtualHost *:80>
ServerName site2.domainname.tld
UseCanonicalName Off
ServerAdmin webmaster@localhost
DocumentRoot /var/www/site2/
</VirtualHost>
And now it works.
Thank you all.
Add new comment