Wordpress or Apache Help Needed
Moderators: snarkout, Patrick, dann
- mowestusa
- Posts: 298
- Joined: Mon Apr 04, 2005 10:27 pm
- Location: Farm Fields of Wheat and Corn
- Contact:
Wordpress or Apache Help Needed
First of all thanks all for the advice on setting up a LAMP in my last post. I now have a Slackware server up and running with apache, mysql, and php.
Now I'm ready to have some fun trying stuff out, but I'm having trouble with my first attempt with Wordpress.
Slack server is running on my home network connected to the same router as all my other home machines. Everything is behind a NAT and there are no ports being forwarded.
This install of Wordpress on the local server seemed to be fine. The five minute install went fine. I can access the new Wordpress blog without issue on the server machine. Everything comes up, and just works. The problem that I'm having is accessing the site from another machine on the network. When I put the following into the url "localhost/wordpress" on the server it comes up.
From another computer on the home network I put in the url "198.165.1.16/wordpress" I get an error "slack.slack.org could not be found please check name and try again." When I put in "198.165.1.16/wordpress/" (Notice only difference is forward slash) I get the Wordpress site but just plan HTML with no templetes or styles or anything. Also all the links fail to work because they are looking for "http://localhost/wordpress/..." which will bring up an error because the documents are not on this home computer, but on the server which is 195.165.1.16.
I'm not sure if this is a setting that I have wrong in Wordpress or in Apache or what. My plan is to move this server into a DMZ and open up port 80 and 22 to it through the router NAT so that it can serve up webpages to the outside world, but I have a feeling that won't work until I get it working on my local network first.
Thanks for any help. By the way, last night's interview was great, and so was the show even with the technical problems.
mowestusa
Now I'm ready to have some fun trying stuff out, but I'm having trouble with my first attempt with Wordpress.
Slack server is running on my home network connected to the same router as all my other home machines. Everything is behind a NAT and there are no ports being forwarded.
This install of Wordpress on the local server seemed to be fine. The five minute install went fine. I can access the new Wordpress blog without issue on the server machine. Everything comes up, and just works. The problem that I'm having is accessing the site from another machine on the network. When I put the following into the url "localhost/wordpress" on the server it comes up.
From another computer on the home network I put in the url "198.165.1.16/wordpress" I get an error "slack.slack.org could not be found please check name and try again." When I put in "198.165.1.16/wordpress/" (Notice only difference is forward slash) I get the Wordpress site but just plan HTML with no templetes or styles or anything. Also all the links fail to work because they are looking for "http://localhost/wordpress/..." which will bring up an error because the documents are not on this home computer, but on the server which is 195.165.1.16.
I'm not sure if this is a setting that I have wrong in Wordpress or in Apache or what. My plan is to move this server into a DMZ and open up port 80 and 22 to it through the router NAT so that it can serve up webpages to the outside world, but I have a feeling that won't work until I get it working on my local network first.
Thanks for any help. By the way, last night's interview was great, and so was the show even with the technical problems.
mowestusa
The second issue about wordpress links and not displaying the CSS I'm pretty sure is a wordpress setting issue. Try setting your site URL to 192.168.1.16/wordpress in your wordpress admin.
The other issue about the forward slash is most likely an apache setting issue. I think I have come up with this before and I had to either add an alias to my virtualhost directive or something along those lines. I'll search around for the fix.
The other issue about the forward slash is most likely an apache setting issue. I think I have come up with this before and I had to either add an alias to my virtualhost directive or something along those lines. I'll search around for the fix.
Chess Griffin
My understandig of wordpress is that you can access the site in one of 2 ways:
'http://YOURURL/'
'http://YOURURL/blog/'
I have mine setup with the latter:
http://pdavila.homelinux.org/blog/
'http://YOURURL/'
'http://YOURURL/blog/'
I have mine setup with the latter:
http://pdavila.homelinux.org/blog/
Last edited by Patrick on Thu Feb 09, 2006 1:38 pm, edited 1 time in total.
Ego contemno licentia
- mowestusa
- Posts: 298
- Joined: Mon Apr 04, 2005 10:27 pm
- Location: Farm Fields of Wheat and Corn
- Contact:
Pat,
I believe that it doesn't matter what the directory it is that you use as long as you have all the program files in that directory. I thought the instructions just used "blog" as an example, but didn't limit it to that name for a directory.
I did however change the name of the directory to "blog", but there was no change in the behavior.
Chess,
I do not have a final "/" in the httpd.conf file. All of the references end with "/htdocs"
Thanks for your help.
I believe that it doesn't matter what the directory it is that you use as long as you have all the program files in that directory. I thought the instructions just used "blog" as an example, but didn't limit it to that name for a directory.
I did however change the name of the directory to "blog", but there was no change in the behavior.
Chess,
I do not have a final "/" in the httpd.conf file. All of the references end with "/htdocs"
Thanks for your help.
- mowestusa
- Posts: 298
- Joined: Mon Apr 04, 2005 10:27 pm
- Location: Farm Fields of Wheat and Corn
- Contact:
Problem #1
=======
- Viewing site from other computer brought up page, but none of the templates or styles were used.
- FIXED THANKS
- I fixed it in wordpress, by setting up the option in Wordpress with the IP address of the server.
Problem #2
=======
- Must enter "198.165.1.16/wordpress/" with network computer, but works with "localhost/wordpress" without the final "/" when accessing from the server computer.
- NOT FIXED, but not really an issue, because in the link tag from the home page I will have to indicate the location, and I can add the final "/".
The fix for problem two seems to create another problem for a server pointing to the internet. That local IP will mean nothing to someone viewing the blog from outside of my network, because 198.165.1.16 could be a computer on their network. I know that when I set up the Slack box one of the steps seemed to be giving it a domain name, I believe that is how I got the slack.slack.org that keeps coming up. That must be stored in a "host" file. I suppose in order to get this to work in the internet and on my home network, I would have to set that domain name during the install for the domain that I will be using, then add a line to every computer on my home network in the "host" file http://www.mowestusa.com = 198.165.1.16 since I don't have a DNS server running on my home network. Or else people will be able to see my website from the internet, but I won't be able to get to it.
I've never had this issue before when I ran a server because I have only run static html with virtual links, not absolute links, so I never had a program generating its own links before. Pat how do you have that set up for your blog. I know that you run it on a server attached to your DSL running Wordpress. What did you do to make it visible to networked computers?
Thanks for the help, I think I will have this ironed out with your help and hints, everyone.
mowestusa
=======
- Viewing site from other computer brought up page, but none of the templates or styles were used.
- FIXED THANKS
- I fixed it in wordpress, by setting up the option in Wordpress with the IP address of the server.
Problem #2
=======
- Must enter "198.165.1.16/wordpress/" with network computer, but works with "localhost/wordpress" without the final "/" when accessing from the server computer.
- NOT FIXED, but not really an issue, because in the link tag from the home page I will have to indicate the location, and I can add the final "/".
The fix for problem two seems to create another problem for a server pointing to the internet. That local IP will mean nothing to someone viewing the blog from outside of my network, because 198.165.1.16 could be a computer on their network. I know that when I set up the Slack box one of the steps seemed to be giving it a domain name, I believe that is how I got the slack.slack.org that keeps coming up. That must be stored in a "host" file. I suppose in order to get this to work in the internet and on my home network, I would have to set that domain name during the install for the domain that I will be using, then add a line to every computer on my home network in the "host" file http://www.mowestusa.com = 198.165.1.16 since I don't have a DNS server running on my home network. Or else people will be able to see my website from the internet, but I won't be able to get to it.
I've never had this issue before when I ran a server because I have only run static html with virtual links, not absolute links, so I never had a program generating its own links before. Pat how do you have that set up for your blog. I know that you run it on a server attached to your DSL running Wordpress. What did you do to make it visible to networked computers?
Thanks for the help, I think I will have this ironed out with your help and hints, everyone.
mowestusa
In your wordpress admin for your blog's URL, do you have the trailing slash at the end? From the looks of the Wordpress instructions, you need that trailing slash.
As to hosting the site live, I run my blog on my home server just like Pat does. I have a domain name that I have registered with dyndns.org. You can use any number of dynamic dns services, but if your ip will change, which it will do occasionally if you have dsl or cable modem, then you need to have a router that will send your updated ip to dyndns.org or use a shell client. It make take a few hours for the dns changes to propagate.
Either way, your domain name will then point to your actual ip address assigned to you by your ISP. You then forward port 80 from your router to the server. From other machines, you don't need to do anything else because if you open up a browser and go to example.com, that will resolve back to your own ip and your router will forward the request to your server.
Once you get that all set up, then you'll need to go back into your wordpress admin and your apache httpd.conf file and change references from 192.168.1.16 to your domain name.
One more thing: the domain name that is asked for during the slack install is just your localdomain name. You can leave it as "localdomain" or whatever. The file in /etc/hosts will list your local ip and local domain like this:
127.0.0.1 localhost.localdomain localhost
192.168.1.16 webserver.slack.org webserver
Once you get your domain name set up with dyndns.org, you could edit the /etc/hosts file (or run netconfig) and put in your actual domain name if you wanted. But it's not really necessary.
My webserver /etc/hosts file is like this:
127.0.0.1 localhost.localdomain localhost
192.168.x.y webserver.localdomain webserver
This way, locally, I can just put "http://webserver" in my browser URL bar and it will go directly to my local server.
As to hosting the site live, I run my blog on my home server just like Pat does. I have a domain name that I have registered with dyndns.org. You can use any number of dynamic dns services, but if your ip will change, which it will do occasionally if you have dsl or cable modem, then you need to have a router that will send your updated ip to dyndns.org or use a shell client. It make take a few hours for the dns changes to propagate.
Either way, your domain name will then point to your actual ip address assigned to you by your ISP. You then forward port 80 from your router to the server. From other machines, you don't need to do anything else because if you open up a browser and go to example.com, that will resolve back to your own ip and your router will forward the request to your server.
Once you get that all set up, then you'll need to go back into your wordpress admin and your apache httpd.conf file and change references from 192.168.1.16 to your domain name.
One more thing: the domain name that is asked for during the slack install is just your localdomain name. You can leave it as "localdomain" or whatever. The file in /etc/hosts will list your local ip and local domain like this:
127.0.0.1 localhost.localdomain localhost
192.168.1.16 webserver.slack.org webserver
Once you get your domain name set up with dyndns.org, you could edit the /etc/hosts file (or run netconfig) and put in your actual domain name if you wanted. But it's not really necessary.
My webserver /etc/hosts file is like this:
127.0.0.1 localhost.localdomain localhost
192.168.x.y webserver.localdomain webserver
This way, locally, I can just put "http://webserver" in my browser URL bar and it will go directly to my local server.
Chess Griffin
- mowestusa
- Posts: 298
- Joined: Mon Apr 04, 2005 10:27 pm
- Location: Farm Fields of Wheat and Corn
- Contact:
Interesting,
Chess wrote,
Now you mentioned the use of the host file. By making that reference that you did in the hosts file of the server does that work for other computers on the network, or do you need to edit the hosts file on all the windows and linux boxes you have on the network?
Chess wrote,
That really works? This isn't my first try at a home server, but I am trying to do something more dynamic and feature rich. I had a server set up a week ago that was just serving up static html. I have an account with NO-IP.com which offers dynamic resolution, which has been excellent. When I try to access the webserver from my network I could never just "www.mydomain.com" and have it work. I would get a domain not found warning. I have DSL hooked up with a Zoom modem/router. However, if I would put in the IP given by the router to the server, the sight would come up. I've never been able to access a server on my network by simply putting in the "www.mydomain.com" in the url. It always had to be the local IP given by the router.Either way, your domain name will then point to your actual ip address assigned to you by your ISP. You then forward port 80 from your router to the server. From other machines, you don't need to do anything else because if you open up a browser and go to example.com, that will resolve back to your own ip and your router will forward the request to your server.
Now you mentioned the use of the host file. By making that reference that you did in the hosts file of the server does that work for other computers on the network, or do you need to edit the hosts file on all the windows and linux boxes you have on the network?
Yes, it works for me right now. I have my site http://www.chessgriffin.com running on my home server using Textpattern (a CMS similar to WordPress) and when I am at home, I can just enter that domain name and it works fine. I used to use WordPress and it worked fine with that as well.mowestusa wrote:I've never been able to access a server on my network by simply putting in the "www.mydomain.com" in the url. It always had to be the local IP given by the router.
No, it you want to use the "shortcut" then you need to add the local IP, local host name, and local domain name of your server in each host file on each computer. That way, each computer knows to resolve "http://webserver" to 192.168.1.16. Of course, that will just get you to the initial page. Once you've correctly fixed your wordpress admin settings to use your actual domain name and not your local IP, then if you went to http://webserver and then clicked on a link on your home page to a blog entry, for example, it will then take you to http://www.mydomain.com/blog-entry-title or whatever. So, you need to get the domain working in order to navigate to all the pages of your site from your other computers.mowestusa wrote:Now you mentioned the use of the host file. By making that reference that you did in the hosts file of the server does that work for other computers on the network, or do you need to edit the hosts file on all the windows and linux boxes you have on the network?
Hopefully, that makes sense, and it's not too much rambling.
Chess Griffin
Here's a concise (but long
) explanation just for the sake of explanation, and for those who have given up by now because their brains have exploded:
When you put http://www.example.com into your browser, it connects to a DNS server to get the IP address of that site. The step you don't see is that your system consults /etc/hosts first. Any name to IP mapping in /etc/hosts will be used instead of going to a DNS server.
If you put
127.0.0.1 google.com
in your /etc/hosts file, any attempt to access google will go to your local system instead! You can have interesting fun with this.
If you want to access any machine on your local LAN, you need a name to IP mapping in /etc/hosts (because the DNS server doesn't know about your LAN). This also allows you to call a machine as many different names as you want. Why would you want to do this? Read on...
When a browser hits a web site it sends an HTTP header that looks like this:
This is asking for "/" (the root) of the server http://www.example.com. Try it. Go to a terminal and do
When you connect, type and hit enter (do me a favor and use a real web site instead of "example.com"). Presto! Everything you wanted to know about that server (that it will tell you). The HEAD request gets you a header, and not the whole web page. Use GET rather than HEAD to get the whole page.
So when apache gets an HTTP request, it knows what hostname is being used. Try doing the telnet connect/ manual HTTP request without the "Host: " line, and you'll probably get an error. That's because most hosts do "virtual hosting" using 1 IP address for many sites. Apache uses the hostname from the HTTP request to decide which web page to serve up.
---------------------------
Boring part starts here.
---------------------------
I've set up virtual hosting on my home server (see the end of httpd.conf for an explanation on doing this). I've got one virtual host named "wimpy" that points to one directory and another virtual host named "gunky" that points to a different directory. The client machines on the LAN have this in their /etc/hosts:
Note both names point to the same machine. So if I put http://wimpy in Firefox, I get one web site. If I put http://gunky in, I get a different site. Fun and convenient for web development at home.
I know this is horribly long and technical, but hopefully it explains things a bit.
When you put http://www.example.com into your browser, it connects to a DNS server to get the IP address of that site. The step you don't see is that your system consults /etc/hosts first. Any name to IP mapping in /etc/hosts will be used instead of going to a DNS server.
If you put
127.0.0.1 google.com
in your /etc/hosts file, any attempt to access google will go to your local system instead! You can have interesting fun with this.
If you want to access any machine on your local LAN, you need a name to IP mapping in /etc/hosts (because the DNS server doesn't know about your LAN). This also allows you to call a machine as many different names as you want. Why would you want to do this? Read on...
When a browser hits a web site it sends an HTTP header that looks like this:
Code: Select all
GET / HTTP/1.1
Host: www.example.com
<blank line>Code: Select all
telnet www.example.com 80Code: Select all
HEAD / HTTP/1.1
Host: example.com
<blank line>So when apache gets an HTTP request, it knows what hostname is being used. Try doing the telnet connect/ manual HTTP request without the "Host: " line, and you'll probably get an error. That's because most hosts do "virtual hosting" using 1 IP address for many sites. Apache uses the hostname from the HTTP request to decide which web page to serve up.
---------------------------
Boring part starts here.
---------------------------
I've set up virtual hosting on my home server (see the end of httpd.conf for an explanation on doing this). I've got one virtual host named "wimpy" that points to one directory and another virtual host named "gunky" that points to a different directory. The client machines on the LAN have this in their /etc/hosts:
Code: Select all
192.168.0.162 wimpy
192.168.0.162 gunkyI know this is horribly long and technical, but hopefully it explains things a bit.
- mowestusa
- Posts: 298
- Joined: Mon Apr 04, 2005 10:27 pm
- Location: Farm Fields of Wheat and Corn
- Contact:
Gomer_X,
What an interesting post. Thanks for the information. Your answers are often very educational, and I appreciate that.
After "Chess" last post I've been doing some checking. It seems that in order to have "www.example.com" resolve back to your home server after you have set up with a Dynamic DNS service, you need a feature called "loopback" on your DSL Modem/Router. After a call to Zoom technical support it doesn't sound very hopeful that I have such a feature. Therefore, you have the explaination why I can't simply put in the url and have it resolve back to my server set up at home. So I believe the work around for me will be the following steps, correct me if I have something wrong.
1. Set up my Slackware server with a static IP (outside the range of my DHCP server on my router).
2. Forward port 80 and 22 to the server.
3. Edit all the host files on my linux boxes and my two Windows XP boxes on the home network so that I have something like the following:
10.0.0.40 http://www.mowestusa.com
I believe this should solve the issue. I never would have realized this issue except that Wordpress uses "absolute" link references instead of the "virtual" link references that I have been putting into my static html pages. So when I accessed the home page, and then when to another directory the webbrowser would simply stay at the same directory root and move into the other directories accordingly, either moving one more deep or moving one more up. I would think Wordpress could do the same thing since they have their set directory structure, but no such luck.
Here is a question for Gomer_X. I've been checking out 1&1, do you know if they allow you to change the permissions of directories with the basic or lowest account? (This is a requirement for eyeOS, which I would like to try).
mowestusa
What an interesting post. Thanks for the information. Your answers are often very educational, and I appreciate that.
After "Chess" last post I've been doing some checking. It seems that in order to have "www.example.com" resolve back to your home server after you have set up with a Dynamic DNS service, you need a feature called "loopback" on your DSL Modem/Router. After a call to Zoom technical support it doesn't sound very hopeful that I have such a feature. Therefore, you have the explaination why I can't simply put in the url and have it resolve back to my server set up at home. So I believe the work around for me will be the following steps, correct me if I have something wrong.
1. Set up my Slackware server with a static IP (outside the range of my DHCP server on my router).
2. Forward port 80 and 22 to the server.
3. Edit all the host files on my linux boxes and my two Windows XP boxes on the home network so that I have something like the following:
10.0.0.40 http://www.mowestusa.com
I believe this should solve the issue. I never would have realized this issue except that Wordpress uses "absolute" link references instead of the "virtual" link references that I have been putting into my static html pages. So when I accessed the home page, and then when to another directory the webbrowser would simply stay at the same directory root and move into the other directories accordingly, either moving one more deep or moving one more up. I would think Wordpress could do the same thing since they have their set directory structure, but no such luck.
Here is a question for Gomer_X. I've been checking out 1&1, do you know if they allow you to change the permissions of directories with the basic or lowest account? (This is a requirement for eyeOS, which I would like to try).
mowestusa
I checked and I was able to create, remove and chmod dirrectories through FTP, so any account with FTP access should allow you to change permissions. You have to get a "business" account (that's $10 a month) in order to have SSH access, but even the beginner account has FTP access.mowestusa wrote: Here is a question for Gomer_X. I've been checking out 1&1, do you know if they allow you to change the permissions of directories with the basic or lowest account? (This is a requirement for eyeOS, which I would like to try).