LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 06-30-2009, 07:35 PM   #1
Zepyr
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
Where to save the php and html files on apache


Okay I am new to linux and have been learning php. anyway I just installed the apache server and the php extensions but I have no Idea where to save the files that I create so I can run them through the server.


Thank you,
Zepyr
 
Old 06-30-2009, 08:06 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,986
Blog Entries: 11

Rep: Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880Reputation: 880
Hi, welcome to lq!
Quote:
Okay I am new to linux and have been learning php. anyway I just installed the apache server and the php extensions but I have no Idea where to save the files that I create so I can run them through the server.


Thank you,
Zepyr
Wherever the servers document root is. And that will be in your apache configuration;
the name and location of which will depend on the distro you've chosen....


Cheers,
Tink

Last edited by Tinkster; 06-30-2009 at 08:21 PM.
 
Old 06-30-2009, 10:00 PM   #3
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 7,931

Rep: Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494Reputation: 1494
In most apache installations, the default location for your website files is the htdocs subdirectory.

I use the Xampp stack, and the files that are visible over the web go in /opt/lampp/htdocs.

You can change this, but there's no good reason to.
 
Old 07-01-2009, 12:49 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,289

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
We need to know which Linux distro & version you've got.
However, if you look in the Apache httpd.conf, the DocumentRoot directive is normally where you would start.
See the docs here for more info: http://httpd.apache.org/

Last edited by chrism01; 07-01-2009 at 12:52 AM.
 
Old 07-01-2009, 12:59 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Quote:
Originally Posted by Zepyr View Post
Okay I am new to linux and have been learning php. anyway I just installed the apache server and the php extensions but I have no Idea where to save the files that I create so I can run them through the server.


Thank you,
Zepyr
That depends on the distribution you are using. If you are putting up your server on RH or Fedora based distros then you might want to put it in /var/www/html by default. But that is by default. You can change the apache configuration.
For Ubuntu based systems that could be /var/www. Again that depends on the apache configuration. You can change that and make your php files reside where you want them to.
 
Old 07-01-2009, 03:16 AM   #6
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,477

Rep: Reputation: 87
Did you use a package manager to get apache, or did you compile it yourself?

IME, for example, compiling Apache 2.0.54 yourself with a standard configuration and installing it will make the htdocs folder be in /usr/local/apache2/htdocs
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I give a user permission to save files to /var/www/html? rotnay6000 Linux - Newbie 10 07-14-2009 08:45 PM
gentoo - php in html files? Izarf Linux - Server 1 05-28-2009 10:10 AM
Apache rending php when filename is x.php.html mastahnke Linux - Server 6 01-22-2007 08:39 AM
Set up Apache to read php IN html code? WorldBuilder Linux - Networking 10 01-27-2004 12:16 PM
Can't save files to /var/www/html/ Panopticon Linux - Newbie 14 09-12-2003 02:03 AM


All times are GMT -5. The time now is 09:49 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration