Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I have done so far:

  • set up LAMP on my laptop that runs on Ubuntu 11.10.
  • uploaded my websites files in /var/www/.

My Problem:

When I visit localhost, all I can see is the sites text. It seems the server can't locate any of the other folders of the site to display the css and other files.

Heres some output from Firebug:

NetworkError: 404 Not Found - http://localhost/css/ui-lightness/jquery-ui-1.8.11.custom.css

NetworkError: 404 Not Found - http://localhost/js/jquery.js

Can someone point me into the right direction of how I can fix this issue?

share|improve this question

migrated from Dec 30 '11 at 16:05

This question came from our site for professional and enthusiast programmers.

closed as too localized by Jorge Castro, Marco Ceppi Jan 1 '12 at 20:44

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Those files do not exist – Calvin Froedge Dec 29 '11 at 21:39
Do you have these files `/var/www/css/ui-lightness/jquery-ui-1.8.11.custom.css' and '/var/www/js/jquery.js'? – Virendra Dec 29 '11 at 21:40
Yes I do. Everythings there it just seems that the server can't find them... Does anyone know what I need to configure? Thanks.. – Shawn Dec 29 '11 at 23:57
could it just be a permission problem? are the files 644 and the folders 755? – duffydack Dec 30 '11 at 16:20
Yes. Its a permission problem. Thanks so much! Thanks to everyone who helped! – Afsheen Khosravian Dec 30 '11 at 23:43

Look in your webserver log, it will give you a more complete description of the file and path it's actually trying to serve up and you'll see more clearly where you've got the paths set up wrong. Also check your docroot to make sure it's pointing to where you're putting all your stuff. Assuming you're using apache, that's the A in lamp, right?

share|improve this answer
webserver log will be in /var/log/apache2/errors – stu Dec 29 '11 at 21:42
Thanks for your response. I have checked my webserver log and I am getting 404 errors on all my GET requests. How exactly can I set up paths? I am guessing my docroot is correct since when I visit localhost I am seeing my websites text, just no css or images or javascript. – Shawn Dec 29 '11 at 23:52
Heres a snippet from the error log: – Shawn Dec 30 '11 at 0:00
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/php_curl.dll' - /usr/lib/php5/20090626+lfs/php_curl.dll: cannot op$ PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/' - /usr/lib/php5/20090626+lfs/ cannot open sha$ [Sun Dec 25 10:43:30 2011] [notice] Apache/2.2.20 (Ubuntu) PHP/5.3.6-13ubuntu3.3 with Suhosin-Patch configured -- resuming normal operations – Shawn Dec 30 '11 at 0:00

take a look here to get started:

after installation is completed you have to define VirtualHost(s) for the sites you want to serve:

note: don't forget to restart apache after you have edited the configuration.

If you develop on your local machine, add the virtual hosts to file /etc/hosts

vim /etc/hosts

based on the configured ServerName you would add the following to the end of the file:

and the ServerName will be served from your local machine.

share|improve this answer
I have set up LAMP I am just having trouble figuring out how to configure it so that the server serves the site correctly. It seems the server can locate index.php in the docroot but it does not know the paths to the other folders. Do you know how I can configure the correct paths in apache to serve the web page correctly? Thanks for your response. – Shawn Dec 29 '11 at 23:55
perfect. so you are missing virtual hosts. I updated the answer, take a look. – udo Dec 30 '11 at 8:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.