Help - Search - Members - Calendar
Full Version: httpsdocs and httpdocs
The Planet Forums > Control Panels > Plesk
icculus
I want to have my httpsdocs mirror my httpdocs. If I manually edit the httpd.include, it works fine until my next reconfig w/ Plesk. It changes it back to httpsdocs. If I keep the httpsdocs and just make a symbolic link, that doesn't work. I guess apache does't want to follow the sym link. Any suggestions other than duplicating my data?
Ales
As you noticed, httpd.include is regularly rewritten by Plesk. But httpd.conf isn't and you should add your directives there.

If it is just the one domain you want this to apply to, you could add it to vhost.conf file. Create the file in the "conf" subdirectory of the domain ( .../vhosts/domain.com/conf). Any directive you put in there will work just as if it was in the httpd.conf.

Regarding the symlink, I have it the other way arround - httpsdocs symlinked to httpdocs - and it works great.

Ales
rhordern
I tried to add an alias so that you could access all the sites on the server with a url like this :

http://www.domain.com/domain/domain2.com but even though I restarted apache :
su -
/usr/local/psa/rc.d/httpd restart
But no good, is there a better way of restarting apache?
This is what I put in the file :
AliasMatch ^/domain/([^/]+)(/(.*))? /usr/local/psa/home/vhosts/$1/httpdocs/$3 and I named the file vhost.conf as the conf directory was empty. I put it there using the rrot so it has got root permissions ...
Also is ther a way to have http://IP/admin instead of http://IP:8443 as the computer I'm on during the week has got a firewall that won't let me see anything with :8443 in the url !!!

Please help ...

Richard
Ales
To restart Apache you could also try the utility that Plesk provides:
/usr/local/psa/admin/sbin/my_apci_rst

But the problem might be elsewhere... Even when I tried the above, Apache still wouldn't accept the new config. So I had to stop Apache and manually kill/stop all the httpd processes and than start Apache, to get it to work... I guess the running processes prevented the new config to be read.

As to the aliasing the 8443 port, I don't know. I have never tried to alias a port to a specific URL and I suspect there might be problems. Try opening a new thread with a more suitable subject line - some people might not see it here...

Ales
rhordern
Ok I guess that the best way is to restart the server ...
ANyway it doesn't matter as I contacted the main central and they said that it wasn't a firewall problem just that their https wasn't set to cope with ports higher than 512 and they fixed it and now I can access the page ...

Richard
visiontime
Greetings!

I am trying to tie httpspdocs to httpdocs so that all files on httpdocs can also be accessed via httpsdocs (SSL) for a specific domain name.

One posting suggested that I change all references to httpsdocs in the /home/httpd/ vhosts/xx.com/conf/httpd.include to httpdocs and I tried that BUT:

1. This does not solve the problem, and

2. Someone else suggested that httpd.include is a file that is constantly being updated by Plesk so it is pointless to depend on that.

Can any body help with this, providing specific instructions? Thanks!

VT
x007
Easy way ;


Do a simlink !! icon_wink.gif

ln -sd /home/httpd/vhosts/xxx.com/httpdocs /home/httpd/vhosts/xxx.com/httpsdocs
bamaster
QUOTE
Originally posted by x007
Easy way ;  


Do a simlink !! icon_wink.gif

ln -sd /home/httpd/vhosts/xxx.com/httpdocs /home/httpd/vhosts/xxx.com/httpsdocs


Let me get this right...

The above command makes all https pages pull up documents within the httpdocs folder, right?

Secondly, I read that I would have to delete the httpsdocs folder (in my case would be empty since all the pages are in httpdocs) before creating the symlink. Is this accurate?
AcornWebs
QUOTE
Originally posted by bamaster
Let me get this right...

The above command makes all https pages pull up documents within the httpdocs folder, right?  

Secondly, I read that I would have to delete the httpsdocs folder (in my case would be empty since all the pages are in httpdocs) before creating the symlink.  Is this accurate?


Here's what I'd do:

Login as Root, and run the following comments:
1. cd home/httpd/vhosts/xxx.com/
2. mv httpsdocs _httpsdocs
3. ln -sd httpdocs httpsdocs

and now when you go to https://xxx.com/thefileinhttpdocs.html it will get it from the httpdocs. So https and http request both use httpdocs.
x007
QUOTE
Originally posted by bamaster
Let me get this right...

The above command makes all https pages pull up documents within the httpdocs folder, right?  

Secondly, I read that I would have to delete the httpsdocs folder (in my case would be empty since all the pages are in httpdocs) before creating the symlink.  Is this accurate?


YES & YES icon_smile.gif
cache
The symlink answers are ok if you just want to set up one domain to run secure pages from the httpdocs directory instead of the httpsdocs directory. But, if you want to change the way it will work for all new domains it's certainly not the way to go.

Instead, create a vhost_ssl.conf file in the conf directory of your master skeleton and add the one line

DocumentRoot /home/httpd/vhosts/@domain_name@/httpdocs

to the file. From then on new domains will serve ssl pages from the httpdocs directory instead of the httpsdocs directory.

If you want to do that to an existing domain, create the vhost_ssl.conf file in the conf directory, add the above line, then run

/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=

to reconfigure the domain, then restart Apache.
blender1
I followed your instructions cache, i can access html files that are stored in my httpdocs and httpsdocs folders no problem. however, when i try to run a php script like a shopping cart it wants to download the files instead of executing them when accessed via https. They run normally when accessed via http.

any ideas on how to fix this would be very helpful?

Thanks
cache
PHP files present a problem because of it's open base dir directive. To run httpdocs files as though they were in the httpsdocs directory you need to symlink the two directories. If you do the following you do not need to do the edits to the vhost_ssl.conf file.

Login ssh and go to the domain's user directory, delete the httpsdocs directory, then recreate it as a symbolic link to httpdocs, then direct Apache to follow that symlink. It's easier than it sounds, just do the following:

cd /home/httpd/vhosts/domain.com
rm -rf ./httpsdocs
ln -s ./httpdocs ./httpsdocs
echo "Options +FollowSymLinks" > .htaccess

(If you already have files in the httpsdocs directory when you do the above they will be deleated, backup accordingly)

This problem, and solution, was discussed in considerable depth on a thread at SWSoft that you may want to consult.
blender1
Since I already followed your previous posting, I need to undo that then? I would undo it by removing the vhost_ssl.com and re-running the following comand:

/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=

Is that correct? then go through and do what you recomended in your latest post:

cd /home/httpd/vhosts/domain.com
rm -rf ./httpsdocs
ln -s ./httpdocs ./httpsdocs
echo "Options +FollowSymLinks" > .htaccess


Is that correct?

By the way thank for the link to the SWSoft discussion. Very helpful.

Thank you.
cache
That's correct. Delete the vhost_ssl.conf and run the reconfigure-vhost command before doing the other 4 steps.
akucharski
I have followed the instructions from swsoft forum referenced abouve, however linking the directory with OSC presents a problem as osc requires the full path of the base directory in its config.php file.

So, if my directory is set to /home/x/x/x/httpdocs/x/x/ and I link httpsdocs then my config file is wrong when I im in https. Did anyone else solve this problem gracefully in PLESK OSC. Right now I have a full code base in both directories. Seems silly.

Thanks
GraphicsGuy
I use OSC and it works fine with httpsdocs symlinked to httpdocs.

The default ms2.2 catalog configure.php file would start out like this:

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
define('HTTP_SERVER', 'http://www.mydomain.com'); // eg, http://localhost - should not be empty for productive servers
define('HTTPS_SERVER', 'https://www.mydomain.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', true); // secure webserver for checkout procedure?
define('HTTP_COOKIE_DOMAIN', 'www.mydomain.com');
define('HTTPS_COOKIE_DOMAIN', 'www.mydomain.com');
define('HTTP_COOKIE_PATH', '/catalog/');
define('HTTPS_COOKIE_PATH', '/catalog/');
define('DIR_WS_HTTP_CATALOG', '/catalog/');
define('DIR_WS_HTTPS_CATALOG', '/catalog/');

And the admin configure.php like this:

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
define('HTTP_SERVER', 'https://www.mydomain.com); // eg, http://localhost - should not be empty for productive servers
define('HTTP_CATALOG_SERVER', 'http://www.mydomain.com);
define('HTTPS_CATALOG_SERVER', 'https://www.mydomain.com);
define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module
define('DIR_FS_DOCUMENT_ROOT', '/home/httpd/vhosts/mydomain.com/httpdocs/catalog/'); // where the pages are located on the server
define('DIR_WS_ADMIN', '/catalog/admin/'); // absolute path required
define('DIR_FS_ADMIN', '/home/httpd/vhosts/mydomain.com/httpdocs/catalog/admin/'); // absolute pate required
define('DIR_WS_CATALOG', '/catalog/'); // absolute path required
define('DIR_FS_CATALOG', '/home/httpd/vhosts/mydomain.com/httpdocs/catalog/'); // absolute path required
akucharski
Yes, this is exactly the way I have it set up, however when im in https

[php]
define('DIR_FS_DOCUMENT_ROOT', '/home/httpd/vhosts/mydomain.com/httpdocs/catalog/'); // where the pages are located on the server
define('DIR_WS_ADMIN', '/catalog/admin/'); // absolute path required
define('DIR_FS_ADMIN', '/home/httpd/vhosts/mydomain.com/catalog/admin/'); // absolute pate required
define('DIR_WS_CATALOG', '/catalog/'); // absolute path required
define('DIR_FS_CATALOG', '/home/httpd/vhosts/mydomain.com/httpdocs/catalog/'); // absolute path required
[/php]

the isnt path '/home/httpd/vhosts/mydomain.com/httpdocs' , it is
'home/httpd/vhosts/mydomain.com/httpsdocs'.

Isnt this causing some small problems for anyone? It did for me. I was getting warning messages. But when I copy the entire httpdocs to httpsdocs and modify the config file it works fine. I am using plesk 7.5 with osc 2ms2.
GraphicsGuy
If you followed these steps:

QUOTE
Originally posted by cache
cd /home/httpd/vhosts/domain.com
rm -rf ./httpsdocs
ln -s ./httpdocs ./httpsdocs
echo "Options +FollowSymLinks" > .htaccess

(If you already have files in the httpsdocs directory when you do the above they will be deleated, backup accordingly)


Then applications looking for httpsdocs will see everything in httpdocs as being in httpsdocs.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.