Error code 404 when accessing php and xml files using Ubuntu 11.10
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Error code 404 when accessing php and xml files using Ubuntu 11.10
I set up a copy of Ubuntu 11.10 a few weeks ago and have been setting it up as a server. I have almost everything working but I am not able to access either xml or php files from either SmartFoxServer or Unity. I have changed the ownership and groups in my www folder to www-data but that didn't get it done. I do have phpmyadmin working, can telnet to the ports that the applications use. If I try http://localhost I do get the Apache screen showing that is working. ANy ideas would be greatly appreciated!
I have included the actual error log info. I am not using this for any web hosting. We run it as a game server.
[Wed Apr 25 09:56:34 2012] [error] [client 192.168.10.103] File does not exist: /var/www/ws/bundles/requiredvalue
[Wed Apr 25 09:56:34 2012] [error] [client 192.168.10.103] File does not exist: /var/www/ws/reporting/exceptionall
I tried running the code you posted and got the reply:
No command 'apachctl' found, did you mean:
Command 'apachectl' from package 'apache2.2-common' (main)
I am fairly new to ubuntu/linux so I may be running it from an incorrect directory location.
Well the No Command error is because you typo'ed the code I gave you lol. And what you should do now that you have your actual error is look and see if those files exist. Start from the bottom and work your way up, make sure to verify the correct capitalization as well as Linux is case sensitive.
Sorry for the bonehead misspelling- here are the results:
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server localhost (/etc/apache2/sites-enabled/000-default:1)
port 80 namevhost localhost (/etc/apache2/sites-enabled/000-default:1)
Syntax OK
Both of the files do exist and are owned by and in the www-data group.
Both of these are php scripts. reporting is the name of the file and exceptionall is what it is trying to find. bundles is a php script and required values is what we are looking for on it. We use this on our production server and have no problems with it. I had copied over the entire www directory from our production server then changed the ownership and groups for all of them.
This does not make any sense to me. If bundles and reporting are your PHP scripts and the required value and exceptionall does not exist you are going to get a 404 error when requesting it. It's pretty straightforward. The only thing that would make sense is if you were doing some mod_rewrite rules on your production server that are not set up on this one. But if a file does not exist, as your stat command tells you, apache will give a 404 error code. If you are trying to pass the values of bundles and reporting to your PHP scripts you would do it with the syntax of bundles.php?variable=requiredvalue
I have included a chunk of the php code so you would have a better idea of what we are doing. We have to download available asset bundles when the player is trying to log in and these are the scripts that handle the initial interface with the database. This has been my sticking point as it appears everything else is working as advertised. The guy who set up the last few of these servers got another job so I am trying to figure out how to make it work.
Your PHP code will make no difference if Apache is looking for the file /var/www/ws/bundles/requiredvalue and it does not exist. Apache handles the request first, locates the files, then processes your PHP and serves that code to your clients browser. So as I said in the last post you more than likely have mod_rewrite or mod_alias rules set in your Apache configuration allowing Apache to read that file. This is not going to do with anything related to PHP at this point.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.