You are here
Hello,
I'm trying to use Turnkey LAMP VM to create my web development environment. I've set up the VM, and created the virtual host, but when I go to the page on my host machine, it won't load.
I know similar questions have been asked before, but I've tried those steps and it doesn't seem to be working.
Here's the steps I've taken:
- Created new user name for the vm
- created a directory with my website at /home/newuser/site
-
Within webmin
-
Navigated to Server > Apache -
Navigated to Create Virtual Host, and entered settings as follows:
-
Handle connections to address: "any address" (default)- kept default checks for "Add name virtual server address (if needed)", and "Listen on address (if needed)"
- Port: 8080 (with radio button seletected on the port box) (also tried 80, but was mainly trying 8080 or something else, just to make sure it wouldn't interfere with me accessing the Webmin portal)
- Server name: I've tried both "Automatic" and creating a dummy "myexamplehost.com". Honestly, I don't really need a host name unless its required. Since this is just a development environment, I'm okay with just going to http://my.ip.add.ress:8080
- Add virtual server to file: kept default "new file under virtual servers directory ..."
- Copy directives from: kept default "nowhere"
-
- Clicked "Create Now"
- Clicked "Apply Changes". I've also tried rebooting the VM.
-
When I try to run it in the browser on my host machine, it wont load.
Any suggestions on how to get this working? I'm new to Turnkey LAMP VMs and Webmin, so I'm not really sure what I did wrong, or where to start debugging it.
I'm using Windows 7 for my host machine running VMWare Player and the latest Turnkey LAMP. I've made very few changes other than whats been described above. I've tried this with both Bridged and Host-only network settings.
Any suggestions on how to fix, or where to start debugging, would be greatly appreciated! Thanks!
Added firewall rule, but still not working
I also (just now) added a Firewall rule to allow TCP traffic on port 8080, and hit "Apply Configuration". While I think that will be necessary, it still didn't solve the problem.
Linux firewall is (IPTables) disabled by default
So adjusting firewall rules won't change anything.
If you want to use port 8080 then you'll need to make sure apache is listening on that port too. I have never successfully managed to get virtual hosts working properly with Webmin (although I'm sure it's possible) so I just edited the config files directly (I created a new config file for each virtual host in /etc/apache2/sites-available/ and enabled it with a2ensite sitename, disableing the current default site with a2dissite default). TBH I think it was actually easier to understand what was going on when editing the files directly, but perhaps thats just me.
I haven't got them handy right now so I can't show you how it was done but after a bit of reading and a little testing I got it all working.
[edit] Just re-reading your post, you have set your test site up in /home/.... so you need to make sure that www-data (the webserver user account) has access to the file(s). It may be better to just make all your vhosts sub-folders of the standard doc root (/var/www).
Jeremy thanks for the input.
Jeremy thanks for the input. I (think I) followed the steps, but its still not loading. Here's what I did...
The result:
I didn't mention adding the port
from memory you need to add the port to the ports.conf (in /etc/apache2/) IIRC it's 'listen 8080'. Also the I think that there should be a trailing slash: <Directory /var/www/sitename/>
Other than that I'm not sure OTTOMH and I'm no authority on these things. Everytime I've set it up I end up having to google for thedetails and keep meaning to document it, but forget. If I get a chance at work tomorrow I'll have a look....
Success!
Thanks Jeremy! That last "listen 8080" command did the trick. Though I put it in the conf file for that virtual host. Does it make a difference between putting it there vs putting it in ports.conf?
Nice!
Technically not because Apache just reads all the config files (if you wanted you could put everything including the virtual host configs in /etc/apache2/apache.conf). But for ease of use (for yourself or others if someone has to come back and fix it later) it is generally advisable to stick to the Ubuntu/Debian conventions (ie use ports.conf for setting). But at the end of the day if you are the only one using it, then do whatever works for you! :)
Add new comment