PDA

View Full Version : Plesk + vB Upload Solution


mrlister
Sat 19th Jan '02, 2:17am
I'm sure everybody who's used Plesk has run into this problem. Where you can't upload anything. There are a couple of hundred threads around here and plesk each telling you different and sometimes similar ways on how to fix it. Well after struggling with my server for hours I've finally came out with a good set of stuff to help you guys out who have plesk installed. I made two versions. One is for all those that don't have a dedicated and ones that do.

Replace domain.com with your domain that the board is currently on.

Dedicated Server
Ok there are a few steps to follow to get it to work.
1. Log into SSH. (If you for any reason don't have SSH I suggest you install it. I'll post instructions below on how to do that.)
2. Execute the following command
pico -w /usr/local/home/vhosts/domain.com/conf/vhost.conf
3. Inside that file put the following.
<Directory /usr/local/psa/home/vhosts/metrogamers.com/httpdocs>
php_admin_value safe_mode 0
php_admin_value open_basedir "/usr/local/psa/home/vhosts/metrogamers.com/httpdocs:/tmp"
</Directory>
Very Important: Make sure it's only 4 lines and no more or less. Extra spaces or lines after </Directory> or before <Directory ...> or even in between the two but make sure that it doesn't have one line open_basedir and then the second "....". Another Important note is this command takes that specific domain out of safe mode which will enable the nix load in your control panel.
4. Go to your forum control panel and Options > Upload Options and then tell it that safe mode is off.

That's it! Now you have nix load and upload both working.


Virtual Host (Shared hosting/no root access)
1. There's not much that you can do but you can e-mail the instructions to the host admin and I'm sure he'll agree because it doesn't pose a threat. Difference between this one and the dedicated one is you don't get safe mode off unless you've got a host that eighter really really trusts you or has gone crazy. ;)
2. Same as the above do:
pico -w /usr/local/home/vhosts/domain.com/conf/vhost.conf
3. Inside that file put the following.
<Directory /usr/local/psa/home/vhosts/metrogamers.com/httpdocs>
php_admin_value open_basedir "/usr/local/psa/home/vhosts/metrogamers.com/httpdocs:/tmp"
</Directory>
Very Important: Make sure it's only 3 lines and no more or less. Extra spaces or lines after </Directory> or before <Directory ...> or even in between the two but make sure that it doesn't have one line open_basedir and then the second "....".
4. Go to your forum control panel and Options > Upload Options and then tell it that safe mode is on and the temp dir is /tmp.


Installing/upgrading openssh. Right off the bat this text below was taken from another post made by dabystru and he deserves credit for it. If you are wondering what's the difference between the two, here it is. If you use telnet to get your root password all i have to do is listen to port 22. Telnet sends passwords in plain text files. To get the root password when using telnet is extremly easy and a HUGE risk. SSH encryptes the password. If you are going to continue to use shell, install openssh-server (and upgrade openssh-clients to the latest version). By default openssh-server is not installed:[root@plesk admin]# rpm -qa | grep -i ssh
openssh-clients-2.5.2p2-5
openssh-2.5.2p2-5
[root@plesk admin]# rpm -e openssh-clients
[root@plesk admin]# rpm -U http://customer.saburovo.com/openssh-2.9p2-8.7.i386.rpm
[root@plesk admin]# rpm -U http://customer.saburovo.com/openssh-clients-2.9p2-8.7.i386.rpm
[root@plesk admin]# rpm -U http://customer.saburovo.com/openssh-server-2.9p2-8.7.i386.rpm
rpm -e openssh-clients is needed to remove openssh-clients installation, otherwise openssh will not upgrade to the latest version because of dependency of openssh-clients on the older version (and you can't upgrade openssh-client before upgrading openssh itself).

After that I had to reboot to make openssh-server work, simple /etc/init.d/xinetd restart did not do the trick. Once this is done, you can login to your server with ssh instead of telnet. To use SSH once installed I suggest you get putty which can be found on google easily.

JamesUS
Sat 19th Jan '02, 5:27am
Thank you mrlister - this looks really good :) I'm going to move it to the vB FAQ forums so that people can benefit from it in the future :)

eva2000
Sat 19th Jan '02, 5:36am
:cool:

better than my post in this FAQ forum regarding the issue :)

Mandable
Mon 25th Feb '02, 8:19am
Ok I think I have this problem.

But I'm not a vB king so I dont understand what it means when it tells me to Log into SSH. I'm not even sure if I got it..what does SSH stand for? I dont even know how to install it..can someone help me because my server admin wont.

Mandable
Mon 25th Feb '02, 6:09pm
help? Please?

No one seems to want to help me on this problem!

chrispadfield
Tue 12th Mar '02, 9:41am
Hi there,

On this:
pico -w /usr/local/home/vhosts/domain.com/conf/vhost.conf

I don't have the directory /usr/local/home/vhosts

should i be creating all those directories because saving in pico is not impressed about the thought of making directories.

or should i be putting them in

/usr/local/psa/home/vhosts/domain.com/conf/vhost.comf
?

cheers

eva2000
Tue 12th Mar '02, 10:40am
Originally posted by Mandable
Ok I think I have this problem.

But I'm not a vB king so I dont understand what it means when it tells me to Log into SSH. I'm not even sure if I got it..what does SSH stand for? I dont even know how to install it..can someone help me because my server admin wont. search and read => http://vbulletin.com/forum/showthread.php?s=&threadid=36065 ;)

eva2000
Tue 12th Mar '02, 10:42am
Originally posted by chrispadfield
Hi there,

On this:
pico -w /usr/local/home/vhosts/domain.com/conf/vhost.conf

I don't have the directory /usr/local/home/vhosts

should i be creating all those directories because saving in pico is not impressed about the thought of making directories.

or should i be putting them in

/usr/local/psa/home/vhosts/domain.com/conf/vhost.comf
?

cheers i believe in the second but to be sure check out plesk.com's forums ;)

Floris
Tue 12th Mar '02, 8:04pm
Has there been a security update or something for the slash/plesk server config software?

freaky
Tue 4th Jun '02, 4:34pm
be sure to restart apache
/usr/local/psa/admin/bin/my_apci_rst

Omitshu
Wed 12th Jun '02, 12:58pm
My host has done that but custom avatars still wont show or upload

Steve Machol
Wed 12th Jun '02, 1:12pm
Are you sure your host has followed these instructions? How do you know?

Omitshu
Wed 12th Jun '02, 1:17pm
one bcause my host said hes done stuff like this for a while i cpoied the whole topic to him, he did it an replied within mintues and wen i tried it avatars wudnt show

mayb its got sumthin to do wid da safe mode dir /tmp or sumthing

Steve Machol
Wed 12th Jun '02, 1:30pm
Originally posted by Omitshu
mayb its got sumthin to do wid da safe mode dir /tmp or sumthing You need to enable safe mode in the Admin CP and specify a safe more directory that's been chmod'd to 777.

Omitshu
Wed 12th Jun '02, 1:41pm
can a safe mode dir be any dir?

Steve Machol
Wed 12th Jun '02, 2:09pm
Yes, any directory that is chmod'd to 777. You need to use the *full and exact* path though.

Giansa
Sun 30th Jun '02, 5:49am
are u sure that the the procedure works also with plesk 2.5?

Merlin3649
Tue 30th Jul '02, 5:50pm
anyways, the first post in this thread is erroneous in certain places. Here's a cleaned up version (which admittedly I compiled through posts in here, Eva's thread on the same subject and another thread in the plesk forums, and the advice from my telnet guru):

(This is for Dedicated Servers, although the procedure is similar to non-dedicated)

1. Log into your server via SSH and switch to root if you need to.

2. run this command, change domain.com to your domain name.

pico -w /usr/local/psa/home/vhosts/domain.com/conf/vhost.conf

3. After that has been run, input the following. Be sure to type this as is, except for changing the domain of course :P

<Directory /usr/local/psa/home/vhosts/domain.com/httpdocs>
php_admin_value safe_mode 0
php_admin_value open_basedir "/usr/local/psa/home/vhosts/domain.com/httpdocs:/tmp"
</Directory>

4. Be sure to save and exit this file once you make those additions.

5. Next restart Apache by running:

/usr/local/psa/admin/bin/my_apci_rst

after about 5-10 minutes (or however long Apache takes to restart), your avatars _should_ be uploading fine now. Be sure that under your VBulletin Options Control Panel you have Safe Mode turned off. It worked for me at least :P

randychase
Sat 10th Aug '02, 3:23pm
Hi, I can't seem to figure out how to enable persmissions to write to the /conf directory.

SSH gives me an error message saying I don't have permission to write the file. Using FTP, I can't do anything in this directory. I tried using CHMOD to 777 for it. Anything else? Thanks!

eva2000
Sat 10th Aug '02, 3:26pm
Originally posted by randychase
Hi, I can't seem to figure out how to enable persmissions to write to the /conf directory.

SSH gives me an error message saying I don't have permission to write the file. Using FTP, I can't do anything in this directory. I tried using CHMOD to 777 for it. Anything else? Thanks! you can't write to those files as a normal user you need to switch to root user to do that

in telnet type

su -

which will prompt you for your root server password

randychase
Sat 10th Aug '02, 3:29pm
THANKS!!!! These pesky details. :)

randychase
Sat 10th Aug '02, 5:14pm
Yikes. It all seemed to work. I was able to upload a test image. Then I did it for my other forum, replacing the domains with the new domain. Save that one to the proper directory. Rebooted the apache server using the command above. Received this message:


pcbstandards.# /usr/local/psa/admin/bin/my_apci_rst
psa: failed to restart Apache server
0


Now, I have lost all access to my websites. I can log into the dedicated server using SSH or LeapFTP, but none of the domains load. Help? Was there something I typed to turn off my domains? I am logged into the root now.

eva2000
Sat 10th Aug '02, 5:20pm
try remove the vhost.conf file for the 2nd forum you did and restart apache does that work ?

if it does i'd double check your typing for the 2nd forum domain's vhost file

randychase
Sat 10th Aug '02, 5:23pm
Sorry for the simple question, how does one delete using SSH?

eva2000
Sat 10th Aug '02, 5:39pm
in the directory containing the file you want to edit/rename

you can rename it

mv oldfilename newfilename

or delete it

rm filename

randychase
Sat 10th Aug '02, 5:52pm
Thanks again. That was it. I very much appreciate all the help you give me (and the VB community!).

eva2000
Sat 10th Aug '02, 8:22pm
Originally posted by randychase
Thanks again. That was it. I very much appreciate all the help you give me (and the VB community!). no probs :D

XTR3ME
Sat 18th Jan '03, 11:18am
for ease of chmod'ing and some other helpful things
you can also give the user rights to bash or whatever shell you desire.

vi /etc/passwd

find the username you need and the very last line should say false, you want to change this to bash or what ever shell you may want. I would only recommend this if you are the server admin and this is one of your domains. Giving this right to users or resellers lets them browse the entire directory structre which is NOT good.

drumsy
Fri 9th May '03, 7:36pm
I'm trying to install SSH, but those links in the first post are invalid. Is there more updated ones that can be provided, as well as what I need to type to shut down MySQL and reboot the server? Once it is rebooted, do I need to enter a command to start MySQL again?