LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-09-2004, 06:40 PM   #1
mosdef
LQ Newbie
 
Registered: Mar 2004
Location: New Mexico, USA
Posts: 6

Rep: Reputation: 0
Angry Where do I put my PHP files and folders?


I'm kind of new to this. I am setting up a RedHat 9.0 server to run 2 seperate intranets. Here is my Problem: I don't know where to put the files and folders for my sites. I want to keep them seperate, but I'm not sure of how to do that. There will be two webmasters for each intranet, so they have their own ftp logins. Am I being clear? Help me please, and if I need to clarify more then just ask. THANKS!!!!!!!
 
Old 03-09-2004, 07:37 PM   #2
bogart
LQ Newbie
 
Registered: Mar 2004
Location: New Zealand
Distribution: Fedora, RH 9, Mandrake 9.2
Posts: 1

Rep: Reputation: 0
Where do I put my PHP files and folders?

If you did a stock standard install then your document root is likely to be /var/www/html. Thus, if you want to access a php file (or any other file for that matter, via a browser, then you need to put the files into a directory under this path. For example, if you have a file:
Code:
<? phpinfo(); ?>
then save it as info.php in the /var/www/html/ directory and then in your broswer type the URL http://localhost/info.php This will tell you if you have Apache loaded with PHP. It will also return you a lot of information including all of the environment variables.
 
Old 03-09-2004, 08:07 PM   #3
mosdef
LQ Newbie
 
Registered: Mar 2004
Location: New Mexico, USA
Posts: 6

Original Poster
Rep: Reputation: 0
So, all my PHP files go in /var/www/html ? Can I create sub folders in that directory and put my PHP files for the two seperate intranets in those? I mean can I do:
mkdir /var/www/html/intranet01
mkdir /var/www/html/intranet02

and store my seperate PHP files in those?
 
Old 03-09-2004, 09:56 PM   #4
secho
Member
 
Registered: Mar 2004
Distribution: Gentoo
Posts: 34

Rep: Reputation: 15
you should be able to create those subdirectories without a problem, but apache may still be setting /var/www/html/ as the document root (so the site would be http://localhost/intranet01 and http://localhost/intranet02). You may want to look at the configuration file for apache. Look for the document root information (this is where all your documents should be). My configuration files for apache2 are in:
/etc/apache2/config/
so its probably something close with redhat 9.


hope this helps.
 
Old 03-10-2004, 10:49 AM   #5
mosdef
LQ Newbie
 
Registered: Mar 2004
Location: New Mexico, USA
Posts: 6

Original Poster
Rep: Reputation: 0
When I created the new directories my .php and even my .html files wouldn't work. All I got was a page not found error. I thought it would be as simple as visiting the url http://ip-address/intranet01/page01.php. Am I wrong on this one? Thanks for all the help I appreciate it lots.
 
Old 03-10-2004, 01:25 PM   #6
secho
Member
 
Registered: Mar 2004
Distribution: Gentoo
Posts: 34

Rep: Reputation: 15
"I thought it would be as simple as visiting the url http://ip-address/intranet01/page01.php. Am I wrong on this one?"

No it is that eays once you get it setup.
Did the .html or .php files work in the root directory? (i.e. http://ip-address/?) If so, check the permissions of the files and the directory.

Also, what error does your browser give you when you try to go to the page? does it say page not found?
 
Old 03-21-2004, 01:35 PM   #7
mosdef
LQ Newbie
 
Registered: Mar 2004
Location: New Mexico, USA
Posts: 6

Original Poster
Rep: Reputation: 0
They worked fine when they were in the root directory. All the permissions are set correctly. I get a Cannot Find Server, This Page Cannot be Displayed Error.
 
Old 08-07-2012, 07:51 AM   #8
Darkside06
LQ Newbie
 
Registered: Jul 2012
Posts: 3

Rep: Reputation: Disabled
Cool Check weather do you have a permission to create a file or folder in /var/www

Hi,
Most of the time New to php in linux face a problem , that they are not able to create any folder or file in var/www ,in that case you have to enable the permission to create a file or folder in /var/www

Step to do that
1.Open you terminal by pressing ctrl+alt+T
2.Then type sudo su
3.Then enter admin password
4.Then you would see like this root@administrator:/home/administrator#
5.In front of that type chmod -Rf 777 /var/www/
6.Check your var/www folder you would be able to create a file or folder there.

cheers!!

Darkside.
 
Old 08-07-2012, 08:14 AM   #9
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Great, 8 year old thread.

Quote:
Originally Posted by Darkside06 View Post
...
5.In front of that type chmod -Rf 777 /var/www/
And allow the whole world to modify anything. Bad advice.
 
Old 08-07-2012, 08:20 AM   #10
Darkside06
LQ Newbie
 
Registered: Jul 2012
Posts: 3

Rep: Reputation: Disabled
Hi Wim

I m Newbie to Php just started few days back and i was stuck in this,but this works for me.
I applogize if there is a mistake by my side, but i m sure people like you will guide me always.

Thank you
 
Old 08-07-2012, 12:16 PM   #11
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
My approach is to let Apache read from somewhere in the user's home directory. Only problem can be if one has a need for apache to write there, but that can solved with permissions.
 
Old 08-07-2012, 08:52 PM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3171Reputation: 3171Reputation: 3171Reputation: 3171Reputation: 3171Reputation: 3171Reputation: 3171Reputation: 3171Reputation: 3171Reputation: 3171Reputation: 3171
Honestly, I believe that you simply must take some time with the Apache docs (and with perusal of the existing Apache configs provided with your distro), and actually learn how Apache takes the URL-string that it has been given and interprets it. There are (of course) a myriad of options, but, "if you keep your eye on the ball, at all times," the task ultimately always begins-and-ends with that URL string.

And ... there are lots of excellent tutorials, both on the Apache web-server site and many places elsewhere.

"You only have to learn this once," but you really do need to take the time to gain understanding of what is really going on, and of the various alternatives that Apache gives you.
 
  


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
Which folders to put all update RPMs? harzfled Fedora 3 03-28-2005 07:44 PM
PHP - how to put an auto <br> at end of line Boby Programming 6 05-04-2004 11:12 AM
Where do you put your files? dbc001 Linux - General 7 02-23-2004 11:04 AM
Where to put files? codedv Linux - General 2 12-14-2003 12:26 PM
How to remove sites once you have put them into folders Silverw0lf Linux - Newbie 1 10-18-2003 02:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:38 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration