LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to STOP using HTTP (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-stop-using-http-870660/)

cheesewizz 03-24-2011 02:58 AM

How to STOP using HTTP
 
Hi,

does anyone knows how to implement HTTPS instead of HTTP in webserver.

i have linux webserver running on centos everyone can able to access thru http
and also https.

my question is how can i fully implement in my web server using HTTPS and stop HTTP.




please help

thanks

EricTRA 03-24-2011 03:04 AM

Hello,

The simplest way would be to redirect http traffic to https and thus forcing use of https. Have a look at this site which explains it very easy. I think this is the simplest way to redirect all traffic. You could also use mod_rewrite but that's more url based I believe. This 'redirect' is general and enforces all traffic to https.

Kind regards,

Eric

cheesewizz 03-24-2011 03:49 AM

Quote:

Originally Posted by EricTRA (Post 4301413)
Hello,

The simplest way would be to redirect http traffic to https and thus forcing use of https. Have a look at this site which explains it very easy. I think this is the simplest way to redirect all traffic. You could also use mod_rewrite but that's more url based I believe. This 'redirect' is general and enforces all traffic to https.

Kind regards,

Eric

Thanks for your reply

I append like this Redirect permanent / https://tailin.localgroupware.com

the problem is I got this error

[root@server ssl]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]
[root@server ssl]# service httpd stop
Stopping httpd: [FAILED]
[root@server ssl]# service httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]


thanks

EricTRA 03-24-2011 04:09 AM

Hi,

Check your configuration again. Something is not right, or your httpd processes didn't shut down correctly. See if any other instances are running, that you don't have any open files related to httpd and try again. Bind your httpd to one IP instead of all and try restarting again.

Kind regards,

Eric

sandy.bhadoriya 03-24-2011 04:54 AM

try netstat and get to know what is running on port 80
and kill that process and restart the httpd services

NM04 03-24-2011 07:26 AM

cheese,
check the "httpd.conf" file and change the address assigned, also it would be better if you can post the log.

Regards.

cheesewizz 03-24-2011 07:04 PM

Quote:

Originally Posted by EricTRA (Post 4301455)
Hi,

Check your configuration again. Something is not right, or your httpd processes didn't shut down correctly. See if any other instances are running, that you don't have any open files related to httpd and try again. Bind your httpd to one IP instead of all and try restarting again.

Kind regards,

Eric

Hi

Thanks for your reply

in my httpd.conf i append like this
# Redirect permanent /foo http://www.example.com/bar
Redirect permanent /var/www/html/groupware https://www.tailin.localgroupware.co...ware/login.php



coz in my web server i have sub folder. for example in my rootpath is in the /var/www/html/ then it has lots of folder like groupware

so users when they browse it, is like this http://www.tailin.localgroupware.com/groupware


now the problem still i can access thru http but and not auto redirect to https


thanks

salemeni 08-16-2011 03:08 AM

Quote:

Originally Posted by cheesewizz (Post 4302367)
Hi

Thanks for your reply

in my httpd.conf i append like this
# Redirect permanent /foo http://www.example.com/bar
Redirect permanent /var/www/html/groupware https://www.tailin.localgroupware.co...ware/login.php



coz in my web server i have sub folder. for example in my rootpath is in the /var/www/html/ then it has lots of folder like groupware

so users when they browse it, is like this http://www.tailin.localgroupware.com/groupware


now the problem still i can access thru http but and not auto redirect to https


thanks

Try to use mod rewrite

Code:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

generics array


All times are GMT -5. The time now is 08:19 PM.