-
Notifications
You must be signed in to change notification settings - Fork 3
/
apache.conf
73 lines (62 loc) · 2.72 KB
/
apache.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<VirtualHost *:80>
# Change to the root directory
<Directory /var/www/url-shortener/public/>
Options FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
# Change to your webmaster mail address
ServerAdmin [email protected]
# Change to your server name
ServerName y-link.ml
# Change to the root directory
DocumentRoot /var/www/url-shortener/public/
DirectoryIndex index.php
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorDocument 404 %{DOCUMENT_ROOT}/error-pages/404.html
ErrorDocument 500 %{DOCUMENT_ROOT}/error-pages/500.html
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/link.php [L]
ExpiresActive On
ExpiresDefault "access 1 second"
#if you don't use ssl, make it in a comment
RewriteEngine on
# Change to your server name
RewriteCond %{SERVER_NAME} =y-link.ml
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
#if you don't use ssl, make it in a comment
<IfModule mod_ssl.c>
<VirtualHost *:443>
# Change to the root directory
<Directory /var/www/url-shortener/public/>
Options FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
# Change to your webmaster mail address
ServerAdmin [email protected]
# Change to your server name
ServerName y-link.ml
# Change to the root directory
DocumentRoot /var/www/url-shortener/public/
DirectoryIndex index.php
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorDocument 404 %{DOCUMENT_ROOT}/error-pages/404.html
ErrorDocument 500 %{DOCUMENT_ROOT}/error-pages/500.html
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/link.php [L]
ExpiresActive On
ExpiresDefault "access 1 second"
# Change to path of the certificate
SSLCertificateFile /root/ssl/y-link.ml.crt
# Change to path of the certificate
SSLCertificateKeyFile /root/ssl/y-link.ml.key
</VirtualHost>
</IfModule>