1

I'm new to Web Development, and intermediately skilled in Linux. My current setup is CrunchBang 11 & I use Geany as my Text Editor. I'm learning how to make websites, got a sample code and I'm playing around with it. It consists of an index.html, main.html, a few css files and jQuery file. I've made a Project Hearth.geany containing all the files.

I've setup LAMP Stack on my laptop (Dell Latitude D630) following instructions in http://www.howtoforge.com/ubuntu_debian_lamp_server

I want to know how I add these content (the whole project) to work on my localhost so I can see it live.

I researched and I was told to add content to a folder called htdocs, the folder was located in my home directory. But, I still cannot see the content.

I want to be able to do something like type localhost/project on my web browser and it should show my website

2
  • 1
    If the folder is reachable anyone can hit the page and its contents. That will depend on the network. To move forward, read about some server side options. ROR is a good place to start learning REST web applications. Commented Jan 2, 2014 at 6:53
  • I'm sorry, I have no idea what you just said. What do you mean by a folder being reachable? Is there a specific place I need to put the above files into so apache can see them? I want to be able to do something like localhost/project on my web browser and it should show my website. Commented Jan 2, 2014 at 7:06

2 Answers 2

1

You should put your 'project' inside ' /var/www ' folder ( it is the web root in the local machine ), then you can access it via localhost/project

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, but I cannot add the whole project folder in '/var/www' and get it to work. I can copy all the files in the project to '/var/www' but then I will not be able to distinguish subsequent projects from this one. I hope I was clear.
may be you have permission issues. Try giving the permission to the www folder. sudo chown [user] /var/www
1

Firstly, I think this post is more suited for the https://serverfault.com/ site, not this, so please move it.

Your web site should sit at the web site root, which in your setup should be

/var/www/

This can be verified by looking at the apache configuration files and searching for the 'DocumentRoot' directive.

This could be in either :

  • /etc/apache2/apache2.conf
  • /etc/apache2/httpd.conf
  • /etc/apache2/sites-available/default

(You will have to do some searching).

As an example, on my test machine

$ cd /etc/apache2
$ grep -r DocumentRoot
sites-available/default:    DocumentRoot /var/www

1 Comment

Thank you. I'll do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.