I have been using the apache which came along with distro. But wanted to try from source too. In the apache which came along with distro has (conf conf.d logs modules run) folders alone, but while i install from source i get (bin build cgi-bin conf error htdocs icons include lib logs man manual modules). Y is that in normal apache(distro) the errors, libs, include folders are not there.
|
Quote:
|
Which do u think is better. I would go with Apache from source as all are placed in a specific folder. Can the redirect can be done using .htaccess too ? or only url redirect is possible using .htaccess
|
Quote:
Quote:
|
redirecting http to https was done using rewrite_module. Is it possible to do the same using .htaccess?
|
Quote:
|
Once https redirect is enabled. All the sites below will be accessed via https right. Bcoz now i have only one small index file for testing. With the RewriteEngine syntax the entire sub folders below it will be accessed via https right.
Then what is the difference between 1.Redirect permanent / https://www.mytest.com/ 2. Using Rewrite Module Also in the following syntax RewriteEngine on RewriteCond %{SERVER_PORT} =443 RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] I would be happy if you explain the RewriteCond and RewriteRule with the various possibilities |
Quote:
Quote:
You use mod_rewrite when you want to do url rewriting based on certain conditions, or some fancy redirecting and so on. Quote:
Apache looks the port it got the request and evaluates it against the RewriteCond(ition). If it's port 443 then it does the rewrite as specified by the RewriteRule, i.e. from plain http to https. Of course in this case you're going to have a loop, as the port will be always 443 and apache will always redirect the request to https If you want, you can have have a look at the apache mod_rewrite documentation for better understanding. Regards |
thanks for providing the details
|
In Apache installed from source(/usr/local/apache) in the httpd.conf file the user and group is showing as daemon. In apache which came with distro(/etc/httpd) is showing as apache. In /etc/passwd Apache user points to /var/www. Now can i change the user and group to apache in /usr/local/apache/conf/httpd.conf and in /etc/passwd i change the document root to /usr/local/apache/htdocs right. Or should i completely remove httpd(distro) and do this..
|
I would suggest you to remove the apache that came with your distro.
The apache user homedir is irrelevant. What you need to do, is to make sure that the actual docroot is owned by the apache user you used in httpd.conf, e.g. Code:
chown -R daemon /usr/local/apache/htdocs |
What must be the owner and group of Apache Web Server. Can the entire Web server be like this
drwxr-xr-x 15 apache apache 4096 Mar 24 23:06 apache or drwxr-xr-x 15 apache root 4096 Mar 24 23:06 apache or changing rights for htdocs alone to apache is enough. Can u specify the owner, group and rights which must be assigned for entire Apache Web Server for it to be a secured one |
Quote:
The rest of the apache files, should be owned by root:root Regards |
What the permissions to be set for entire apache files
|
Quote:
|
All times are GMT -5. The time now is 01:26 PM. |