Explorar el Código

* install: activar modulo mod_rewrite
* Configurar ficheros para URL corta

Guzmán Castanedo Villalba hace 5 años
padre
commit
fb1f26f904

+ 4 - 0
etc/apache2/apache2.conf

@@ -218,6 +218,10 @@ LogFormat "%{User-agent}i" agent
 # Include of directories ignores editors' and dpkg's backup files,
 # see README.Debian for details.
 
+# Hide Apache version
+ServerTokens Prod
+ServerSignature Off
+
 # Include generic snippets of statements
 IncludeOptional conf-enabled/*.conf
 

+ 3 - 0
etc/apache2/conf/httpd.conf

@@ -349,6 +349,9 @@ EnableSendfile on
 
 # Supplemental configuration
 #
+# Hide Apache version
+ServerTokens Prod
+ServerSignature Off
 # Load config files in the "/etc/httpd/conf.d" directory, if any.
 IncludeOptional conf.d/*.conf
 # Load Virtual Host's in "/etc/httpd/sites-enabled"

+ 4 - 0
etc/apache2/sites-available/mediawiki.conf

@@ -6,5 +6,9 @@
 	LogFormat "%h %l %u %t \"%r\" %>s %b" common
 	CustomLog logs/access.log common
 
+	RewriteEngine On
+	RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]
+	RewriteRule ^/*$ %{DOCUMENT_ROOT}/index.php [L]
+
 </VirtualHost>
 

+ 3 - 0
install

@@ -702,6 +702,9 @@ configurarApache() {
 			ln -s /var/log/apache2 /etc/$webServerName/logs 2>/dev/null
 			comprobarError $? 108
 		fi
+		# Activamos mod_rewrite (no viene activado por defecto)
+		a2enmod rewrite >/dev/null 2>&1
+		comprobarError $? 108
 	elif [ $rhelOS = true ];then
 		apacheConfFile="./etc/apache2/conf/httpd.conf"
 		welcomeConfFile="/etc/apache2/conf.d/welcome.conf"