LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 03-13-2010, 12:11 PM   #1
ntrimgs
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Rep: Reputation: 0
Question Permission Problems on Virtual Dedicated Server


I just began leasing a VDS from a well known hosting company and set everything up the way I thought, but when I uploaded my site, 3 of the most important functions didn't work:

- file uploads through the browser (simple HTML form and PHP script)
- directory creation on the fly (simple PHP command)
- writing to a .txt file (simple PHP script)

I set the permissions wide open in these appropriate directories where this all takes place but it still doesn't work. The hosting company doesn't have an answer and nobody else does either. I figure this would be the best place to go.

Any ideas?
 
Old 03-13-2010, 12:35 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Php safe_mode on ?
 
Old 03-13-2010, 12:41 PM   #3
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
For starters, you can put "echo" debug statements in your PHP scripts, and look at your Apache access and error logs. You should make sure:

a) You've defined the correct users and groups
b) Set the appropriate directory permissions
c) Set the appropriate httpd.conf permissions
d) Configured .htaccess

Do NOT (repeat: do NOT!) allow unlimited access to "everybody" from any internet-facing host. Not even a honeypot

Good luck, and keep us posted!

PS:
Smoker and I apparently posted at exactly the same time.

"Safe mode" is *definitely* a possibility:
http://php.net/manual/en/features.safe-mode.php

But please listen to my other points, too Just because it's "virtual" doesn't mean the Bad Guys can't do a lot of damage. IMHO...

Last edited by paulsm4; 03-13-2010 at 12:46 PM.
 
Old 03-13-2010, 12:52 PM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
What if it's a windows server ?
Thoughtfully, that little detail was kept private. As was the php version, and whether the scripts are third party or self written.

Maybe that's why there are no answers?

Personally I would have thought a webhost forum would be a better place to ask.
http://www.webmasterground.com/
 
Old 03-13-2010, 01:52 PM   #5
ntrimgs
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by smoker View Post
Php safe_mode on ?
safe_mode is set to off
 
Old 03-13-2010, 01:55 PM   #6
ntrimgs
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by paulsm4 View Post
For starters, you can put "echo" debug statements in your PHP scripts, and look at your Apache access and error logs. You should make sure:

a) You've defined the correct users and groups
b) Set the appropriate directory permissions
c) Set the appropriate httpd.conf permissions
d) Configured .htaccess
I'm sure it's one of these issues:
I have not set correct users and groups other than what was set when I got the server.

I did open all the permissions up in the directories.

I did nothing with the httpd.conf permissions.

I did not configure .htaccess.

The server has access to SSH, but it seems when I type the one and two letter codes in that I've found on internet help forums, it doesn't do anything.
 
Old 03-13-2010, 01:57 PM   #7
ntrimgs
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by smoker View Post
What if it's a windows server ?
Thoughtfully, that little detail was kept private. As was the php version, and whether the scripts are third party or self written.

Maybe that's why there are no answers?

Personally I would have thought a webhost forum would be a better place to ask.
http://www.webmasterground.com/
It's a Linux server running PHP 5.1.6
 
Old 03-13-2010, 03:24 PM   #8
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
safe_mode is set to off
And you've confirmed this by looking at the results of "phpinfo()", correct?

Quote:
The server has access to SSH, but it seems when I type the one and two letter codes in that I've found on internet help forums, it doesn't do anything.
I don't know what you mean. Please clarify.

Quote:
I did open all the permissions up in the directories.
<= You do NOT (repeat, do NOT!) want "777" permissions on
ANY web server that faces the Internet.
Not even a virtual machine!

I have not set correct users and groups other than what was set when I got the server.
<= Fair enough. And one of those users is your web server user.
Does this user have read/write permissions to the director(ies) in question?

I did nothing with the httpd.conf permissions.
<= Fair enough.
But what about the <Directory> claus(es) in your httpd.conf?
Quote:
For starters, you can put "echo" debug statements in your PHP scripts, and look at your Apache access and error logs
<= This is THE single most important thing you can do at this point. What are the results?
Also: perhaps selinux is active, and causing you grief?

Keep us posted ... and don't forget to "thank" smoker or I, if we've helpd.
 
Old 03-13-2010, 04:40 PM   #9
ntrimgs
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Yes, I confirmed safe_mode is off by looking at the "phpinfo()"

What I mean by the codes that I'm trying to type in via SSH, here is an example from what I got off the internet:

Type:

1. “cd /etc”
2. “ls”
Check that there is the php.ini listed if not you will have to ask your hosting provider where it is.
3. “vi php.ini”
Find the bit in php.ini you would like to edit.
4. “i” – This enables you to edit the php.ini file
5. After changing the file, please Esc.
6. “:wq” – (w = saves the file, q = quit)
7. reboot your server and your done.


By looking at the phpinfo(), I see the upload_tmp_dir is set to "no value", so I was told to set that to a directory. But whenever I tried typing any of the above into the command line, it wouldn't do anything but say something like "directory not found".

I have a company that wants to charge me $125 to change the user apache is running under. He said that is the problem. That's one reason I'm coming here - to get another oppinion.
 
Old 03-13-2010, 05:19 PM   #10
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Don't type the quotes in, and type exactly what it says.
Only one line at a time.
You need to be root to edit php.ini

after
Code:
cd /etc
Type
Code:
ls -l php.ini
And you can see who owns it.

Don't reboot your server, just restart apache.

Last edited by smoker; 03-13-2010 at 05:22 PM.
 
Old 03-13-2010, 06:06 PM   #11
ntrimgs
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by smoker View Post
Don't type the quotes in, and type exactly what it says.
Only one line at a time.
You need to be root to edit php.ini
How do I get to root once I open up the SSH screen?
 
Old 03-13-2010, 09:55 PM   #12
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
I thought you said you were in charge of this server ?
 
Old 03-13-2010, 10:14 PM   #13
ntrimgs
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by smoker View Post
I thought you said you were in charge of this server ?
I am in a way. It's a virtual server so other users are on it but they say the partitioned space I have is "virtually" a server on its own because I have all the functionality and freedom of having a dedicated server. So I don't know if I have access to root or not.
 
  


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
Cannot install application on a virtual dedicated server raydona Linux - Software 1 06-03-2009 09:12 PM
Verify dedicated server is not a virtual server. obcJack Linux - Software 1 01-23-2009 04:11 PM
virtual dedicated web server bottlenecks (CPU?) GaijinPunch Linux - Software 14 01-29-2008 06:41 AM
Backup RedHat9 Virtual Dedicated Server malaka56 Linux - Software 1 01-05-2006 12:49 AM
i have taken a domain name. how to set it up on my virtual dedicated server phpsharma Linux - General 4 03-15-2005 08:30 PM


All times are GMT -5. The time now is 01:23 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration