Skip to content

Instantly share code, notes, and snippets.

@merolhack
Last active October 2, 2015 18:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merolhack/2366217ec177d61be24c to your computer and use it in GitHub Desktop.
Save merolhack/2366217ec177d61be24c to your computer and use it in GitHub Desktop.
REHL(CentOs & Oracle Linux): Instalación y configuración de Apache
# Instalar Apache de los repositorios de REMI
yum --enablerepo=remi install httpd -y
# Iniciar servicio
service httpd start
# Iniciar servicio al iniciar el sistema
chkconfig httpd on
# Agregar regla a IPTables para el puerto 80
iptables -I INPUT 5 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
# Guardar regla:
service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
# Revisar configuración de IPTables
service iptables status
nano /etc/sysconfig/httpd
+ HTTPD_LANG=en_US.UTF-8
+ export LANG=en_US.UTF-8
nano /etc/httpd/conf/httpd.conf
+ # Locale lang
+ SetEnv LANG en_US.UTF-8
+ SetEnv LC_ALL en_US.UTF-8
# Habilitar el estado del servidor
nano /etc/httpd/conf/httpd.conf
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
#
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from all
</Location>
# Habilitar la información extendida del estado del servidor
nano /etc/httpd/conf/httpd.conf
#
# ExtendedStatus controls whether Apache will generate ""full"" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the ""server-status"" handler is called. The default is Off.
#
ExtendedStatus On
# Habilitar la información del servidor
nano /etc/httpd/conf/httpd.conf
#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from all
</Location>
nano /etc/httpd/conf/httpd.conf
- ServerSignature On
+ ServerSignature Off
- ServerTokens OS
+ ServerTokens Prod
- Options Indexes FollowSymLinks
+ Options -Indexes FollowSymLinks
nano /etc/httpd/conf/httpd.conf
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment