Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
I have no problem getting php to work under root, but when I copy the apache Dir to a users home Dir (so I can give them access to thier own web server) php won't work.
What do I need to do to enable php for other users?
Are you sure it is php that does not work?
If you put a plain html file in the user's home directory, does that work?
Yes, Plain html works fine. I have no problem having multiple users, all with their own apache in their home dir (/home/UserName/apache). All run off separate ports (lan/Wan) ... php only responds to root server /var/www/html/index.php (example).
Not overtly versed with php yet, is this something I'll need to config within php somewhere? If so what/where?
I like setting up apache this way to keep it as isolated from root as possible, also makes experimenting easy.
You should edit php.ini so that the line reads:
user_dir = apache
Tried this, nothing.
This is most likely a big part of the problem:
I have the included version of apache installed, but I removed the existing apr/apr-util and installed the newest versions so I could config/install apache-2.4.3 that I downloaded.
So this gives me an apache2 dir under path= /usr/local/apache2
I then copy this apache2 to my Users home dir and rename it 'apache' path= /home/username/apache
At which point I edit its httpd.conf file for that users dir. (ports/access etc...)
So...php works in the pre-configured pre-installed apache...but not for my 2.4.3. Php paths are obviously not configured correctly. I would really like to figure this out, once again I appreciate your suggestions. (maybe this extra info will clear things up a bit... )
This is the default setting for apache. Most Linux distros will have a public_html directory in the /home/user directory. If not you can create it. Which Linux distribution are you using? You would access files in that directory with the h t t p://localhost/~username/index.html. Replace the localhost with your ip or server name. You can then create other directories/sub-directories/files there. You should be able to change the User_Dir entry from public_html to some other directory in the user /home directory as long as you make all the changes in the configuration files. I've never seen the need to change it myself so can't verify that.
You should be able to change the User_Dir entry from public_html to some other directory in the user /home directory as long as you make all the changes in the configuration files.
...fun.
I'm using Centos 6.3, currently trying to implement the info you have offered, thank you
I'm curious, are you thinking I'm try to use the virtual hosts provided with the auto installed/yum install httpd apache? I don't want to use this version, /var/www/html/ /etc/httpd/conf/httpd.conf
I have manually downloaded and installed apache.2.4.3 and it's path is /usr/local/apache2 all config files I should need are in this dir. Of course I then copy the apache2 server to a users home dir and configure it from there.
I've been stuck using the other apache server because it's the only one that php will play with.
Would you agree or disagree with this approach? Should I scrap this and focus on virtuals?
Trying out different configs is relatively painless as I'm using VMs for development.
Last edited by TheQuicken; 03-02-2013 at 10:14 PM.
Sorry, the suggestion I posted above is only for virtual hosts. I have Apache configured on a localhost and have access to directories/files in the /home/user/public_html directory. I'm not using CentOS or the version of apache you are. I have a modules.d directory in the /etc/httpd directory and in that directory is a file named 67_mod_userdir.conf which has a Directory entry relating to public_html. You might look for a file with a similar name and try that. It's been so long since I've done this I really don't remember. You could also take a look at the Apache site below:
Have you made the change in the php.ini file. If you can access other files in the user directory but not php files, that would seem to be the problem?
Sorry, the suggestion I posted above is only for virtual hosts. I have Apache configured on a localhost and have access to directories/files in the /home/user/public_html directory. I'm not using CentOS or the version of apache you are. I have a modules.d directory in the /etc/httpd directory and in that directory is a file named 67_mod_userdir.conf which has a Directory entry relating to public_html. You might look for a file with a similar name and try that. It's been so long since I've done this I really don't remember. You could also take a look at the Apache site below:
Have you made the change in the php.ini file. If you can access other files in the user directory but not php files, that would seem to be the problem?
Seems like we've been reading the same documentation lol, I agree the solution lies in the php.ini. Fun part is trying to configure it for the way I want to implement apache. There is plenty of documentation for virtual setup...just not much of anything for my preferred approach.
Once again, I appreciate your time and suggestions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.