Showing posts with label Apache HTTP Server. Show all posts
Showing posts with label Apache HTTP Server. Show all posts

Tuesday, September 12, 2017

Apache HTTP Server: Redirect All HTTP Requests to HTTPS

Command:

# diff httpd.conf httpd.conf.bkup20170901


Result:

1005c1004
< <VirtualHost *:80>
---
> #<VirtualHost *:80>
1008,1009c1007
<      ServerName www.SERVERNAME.com
< Redirect / https://www.SERVERNAME.com/
---
> #    ServerName dummy-host.example.com
1012,1013c1010
< </VirtualHost>
<
---
> #</VirtualHost>


Reference:

https://stackoverflow.com/questions/4083221/how-to-redirect-all-http-requests-to-https/21798882#21798882

Monday, October 3, 2016

macOS Sierra: Apache: Enable PHP and User Directory

Command:

$ sudo vi /etc/apache2/httpd.conf
$ diff /etc/apache2/httpd.conf.original /etc/apache2/httpd.conf


Result:

166c166
< #LoadModule userdir_module libexec/apache2/mod_userdir.so
---
> LoadModule userdir_module libexec/apache2/mod_userdir.so
169c169
< #LoadModule php5_module libexec/apache2/libphp5.so
---
> LoadModule php5_module libexec/apache2/libphp5.so


Command:

$ sudo apachectl restart