MediaTemple Plesk Dedicated Virtual - pretty url, sessions, permissions fix
Permalink
Hey guys,
I just finished moving my site over to my dedicated virtual server with mediatemple.
This server is running Plesk and FastCGI, so I wanted to share a few issues I came across and how I fixed them to save some of you some time in the future in case you run into these issues.
At first, I could not write to folders and the permissions were locking up. So I did the following....
You'll first need to enable root access and set the root password via your AccountCenter.
Enable root access:
http://wiki.mediatemple.net/w/DV:Enable_root_access...
Run PHP as FastCGI and resolve Apache permission errors:
http://wiki.mediatemple.net/w/DV:Run_PHP_as_FastCGI_and_resolve_Apa... rrors
Once you implement this, you can run this command to update the ownership and permissions to 'standard' values. Note that some adjustments may need to be made depending on your application. Generally, files should be '644' (rw-r--r--) and directories should be '755' (rwxr-xr-x); Files with secrets (such as database passwords) should be 400 or 600 (r-------- or rw-------). You can use this command as root via SSH to properly set ownership and permissions:
cd /var/www/vhosts/jordanwlee.com/httpdocs && chown -R jordanwlee:psacln * && find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;
Once this was resolved, I discovered I encountered session errors on the server. So to address this I did the following:
http://kb.mediatemple.net/questions/652/%28dv%29+Session+Save+Path+... he+Vhost.conf
Keep in mind, in Terminal, you can save changes by using
To help you out, I am including a link to a tutorial on the "vi" editor on your (dv) Dedicated-Virtual Server. This should help you out with the task you are trying to accomplish:
http://wiki.mediatemple.net/w/DV:Use_vi_to_edit_files...
After trying this, I was still getting the session error messages on all of my pages. I found an alternate work-around for this by modifying the permissions on the original session folder (/var/lib/php/session, setting it to 1777 -- this is still secure).
The biggest issue was encountering a "No input file specified" once I had moved over the site and got everything installed.
I am currently running 5.4.1 with this site and I wanted to enable pretty urls instead of having index.php in the URL path. I could rework the .htaccess file but it would only refresh to the homepage or I could view all the pages of the site without pretty urls. I found a workaround on this forum to edit the .htaccess file, but it wasnt working on the Media Temple server.
My Fix:
In concrete/libraries/request.php
Replace line 72
with this code
And make your .htaccess file have this code
After many hours of troubleshooting and contacting mediatemple for support, this was the best fix and now everything is working correctly. I hope that this thread can serve as a resource for people who may encounter these issues later on while using MediaTemple or any similar host running Plesk.
Oh and if you want to check out my site, it's jordanwlee.com
I just finished moving my site over to my dedicated virtual server with mediatemple.
This server is running Plesk and FastCGI, so I wanted to share a few issues I came across and how I fixed them to save some of you some time in the future in case you run into these issues.
At first, I could not write to folders and the permissions were locking up. So I did the following....
You'll first need to enable root access and set the root password via your AccountCenter.
Enable root access:
http://wiki.mediatemple.net/w/DV:Enable_root_access...
Run PHP as FastCGI and resolve Apache permission errors:
http://wiki.mediatemple.net/w/DV:Run_PHP_as_FastCGI_and_resolve_Apa... rrors
Once you implement this, you can run this command to update the ownership and permissions to 'standard' values. Note that some adjustments may need to be made depending on your application. Generally, files should be '644' (rw-r--r--) and directories should be '755' (rwxr-xr-x); Files with secrets (such as database passwords) should be 400 or 600 (r-------- or rw-------). You can use this command as root via SSH to properly set ownership and permissions:
cd /var/www/vhosts/jordanwlee.com/httpdocs && chown -R jordanwlee:psacln * && find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;
Once this was resolved, I discovered I encountered session errors on the server. So to address this I did the following:
http://kb.mediatemple.net/questions/652/%28dv%29+Session+Save+Path+... he+Vhost.conf
Keep in mind, in Terminal, you can save changes by using
:x!
To help you out, I am including a link to a tutorial on the "vi" editor on your (dv) Dedicated-Virtual Server. This should help you out with the task you are trying to accomplish:
http://wiki.mediatemple.net/w/DV:Use_vi_to_edit_files...
After trying this, I was still getting the session error messages on all of my pages. I found an alternate work-around for this by modifying the permissions on the original session folder (/var/lib/php/session, setting it to 1777 -- this is still secure).
The biggest issue was encountering a "No input file specified" once I had moved over the site and got everything installed.
I am currently running 5.4.1 with this site and I wanted to enable pretty urls instead of having index.php in the URL path. I could rework the .htaccess file but it would only refresh to the homepage or I could view all the pages of the site without pretty urls. I found a workaround on this forum to edit the .htaccess file, but it wasnt working on the Media Temple server.
My Fix:
In concrete/libraries/request.php
Replace line 72
$path = Request::parsePathFromRequest('ORIG_PATH_INFO');
with this code
$path = Request::parsePathFromRequest('REDIRECT_URL'); if (!$path) { $path = Request::parsePathFromRequest('ORIG_PATH_INFO'); }
And make your .htaccess file have this code
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !(index\.php) RewriteRule .* index.php [L] </IfModule>
After many hours of troubleshooting and contacting mediatemple for support, this was the best fix and now everything is working correctly. I hope that this thread can serve as a resource for people who may encounter these issues later on while using MediaTemple or any similar host running Plesk.
Oh and if you want to check out my site, it's jordanwlee.com
It wasn't configured for anything else. The odd thing is that I have other domains running versions of C5 on the same server and have never experienced anything like these issues before. I also have subdomains under jordanwlee.com running C5 without any hangups as well.
I've moved around and launched around 5 C5 sites and I have never run into anything like this.
I'm just glad I got these issues solved and could contribute some kind of knowledge back to the C5 community.
I've moved around and launched around 5 C5 sites and I have never run into anything like this.
I'm just glad I got these issues solved and could contribute some kind of knowledge back to the C5 community.
Well, since you are on a similar configuration as me you should definitely check out the guide for running a centralized core with Plesk - I've been running a shared core for almost a year on my dv and its been great -http://www.concrete5.org/documentation/how-tos/plesk-multiple-insta...
This may help eliminate some problems and keep things consistent from site to site.
This may help eliminate some problems and keep things consistent from site to site.
MediaTemple (dv) runs PHP as module mode.
In order for PHP to run on mediatemple (dv), you need to switch the group and the owner of the files to "apache:apache" before you install concrete5.
- log onto SSH as root
- go to the concrete5 root directory
- use "chown -R apache:apache *" to switch the ownership and the group of all concrete5 files to apache
That's all you have to do to run the installation.
In terms of the speed, I've modified httpd.conf and my.conf, and installed APC to speed up the concrete5.
It's really depends on how many access you have...
Here are the actual sites running on DV with the above configuration.
http://yokosonews.com/
http://www.jffla.org/
(and etc)
FastCGI is good idea... but if you change the file ownership, you won't have to deal with the problem... so I took this routes.
In order for PHP to run on mediatemple (dv), you need to switch the group and the owner of the files to "apache:apache" before you install concrete5.
- log onto SSH as root
- go to the concrete5 root directory
- use "chown -R apache:apache *" to switch the ownership and the group of all concrete5 files to apache
That's all you have to do to run the installation.
In terms of the speed, I've modified httpd.conf and my.conf, and installed APC to speed up the concrete5.
It's really depends on how many access you have...
Here are the actual sites running on DV with the above configuration.
http://yokosonews.com/
http://www.jffla.org/
(and etc)
FastCGI is good idea... but if you change the file ownership, you won't have to deal with the problem... so I took this routes.
I have installed other versions of C5 on my MT server without switching to apache and the install seemed to work fine and I haven't ran into any problems.
The example I gave above is the first time I have run into this issue and I have a few other sites running on the server that seems to be working fine now.
Will I run into issues later on with these sites even though the install went fine?
The example I gave above is the first time I have run into this issue and I have a few other sites running on the server that seems to be working fine now.
Will I run into issues later on with these sites even though the install went fine?
@hursey013
Thanks so much for the infor about running a core version on Plesk! I am definetly interested in that.
A few questions for you though...
1. How is it with databases and configuring? Any hangups?
2. Other than each site running the same core files, what are some other benefits opposed to running core files under each install?
Thanks again, would you mind if I contacted you sometime in the future if I run into any hangups when I decide to try this?
Thanks so much for the infor about running a core version on Plesk! I am definetly interested in that.
A few questions for you though...
1. How is it with databases and configuring? Any hangups?
2. Other than each site running the same core files, what are some other benefits opposed to running core files under each install?
Thanks again, would you mind if I contacted you sometime in the future if I run into any hangups when I decide to try this?
Databases work the same way - each installation needs its own - nothing changes there. The main benefit for me is that I run about a dozen sites on my server and by updating the core files I instantly update every instance of c5 of my server - always running the latest and greatest, thats the main benefit. Not to mention, I also run APC, and if the server is only using one set of core files, rather than loading and caching a dozen different c5 installs its a much lighter load on the server and things run much more efficiently.
Feel free to contact me - I'm by no means an expert, but I have have spent an extensive amount of time tweaking my setup.
Feel free to contact me - I'm by no means an expert, but I have have spent an extensive amount of time tweaking my setup.
I'm not running concrete5 under FastCGI. I'm running concrete5 under PHP module mode.
I'm suggesting the different approach.
This is a bit troublesome since you need to change the ownership of the files when you need to manually change the file.
But I'm centralizing the core under multi-domains. Because of the structure of Plesk and users management, I've decided to run concrete5 as Apache user.
If you want to run a single core concrete5 under multi-domains, you should consider not using FastCGI.
If multiple concrete5 is running only under the same plesk user (a domain and sub-domains) you can use FastCGI.
I'm suggesting the different approach.
This is a bit troublesome since you need to change the ownership of the files when you need to manually change the file.
But I'm centralizing the core under multi-domains. Because of the structure of Plesk and users management, I've decided to run concrete5 as Apache user.
If you want to run a single core concrete5 under multi-domains, you should consider not using FastCGI.
If multiple concrete5 is running only under the same plesk user (a domain and sub-domains) you can use FastCGI.
I have a mediatemple (dv) with several instances of c5 and did not run into any of the issues you are referring to?