Skip to content

Latest commit

 

History

History
101 lines (84 loc) · 2.18 KB

apache.md

File metadata and controls

101 lines (84 loc) · 2.18 KB

apache server

apache tutorial

apache installation apache settings

manage httpd

# apache server installation, apache server run, web server run, webserver start
sudo su
yum update -y
yum install -y httpd
service httpd start
chkconfig httpd
chkconfig httpd on
vim /var/www/html/index.html

debian

# installation
sudo su
apt update -y
apt install -y apache2

# service 
sudo systemctl status apache2.service
sudo systemctl start apache2.service

# change index html
vim /var/www/html/index.html

# Uncomplicated FireWall
ufw app list
ufw allow 'Apache'
ufw status

# enable module
a2enmod rewrite

# disable module
# http://manpages.ubuntu.com/manpages/trusty/man8/a2enmod.8.html
a2dismod rewrite

# enable or disable site/virtual host
# http://manpages.ubuntu.com/manpages/trusty/man8/a2ensite.8.html
a2dissite *.conf
a2ensite my_public_special.conf

apache management

sudo service apache2 start
sudo service apache2 restart

apache SSL

activate ssl module

sudo a2enmod ssl
sudo a2dismod ssl

creating self-signed certificates

sudo make-ssl-cert generate-default-snakeoil --force-overwrite

check certificates

sudo ls -la /etc/ssl/certs/ssl-cert-snakeoil.pem
sudo ls -la /etc/ssl/private/ssl-cert-snakeoil.key

cert configuration

vim /etc/apache2/sites-available/default-ssl.conf
                SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

Generating a RSA private key

openssl req -new -newkey rsa:2048 \
-nodes -out cherkavideveloper.csr \
-keyout cherkavideveloper.key \
-subj "/C=DE/ST=Bavaria/L=München/O=cherkavi/CN=cherkavi developer" \
vim /etc/apache2/sites-available/default-ssl.conf
SSLCertificateFile "/path/to/www.example.com.cert"
SSLCertificateKeyFile "/path/to/www.example.com.key"