Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Commit

Permalink
More for bug 1275883
Browse files Browse the repository at this point in the history
Removes the .htaccess file in favor of adding script to the update.sh
script which revises the main httpd.conf to disable index listings and
to make all files and directories starting with “.git” result in 404
errors.

This is a much more reliable solution than what I was doing before, I
think.
  • Loading branch information
Eric Shepherd committed May 27, 2016
1 parent 9192ae5 commit 27af007
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .htaccess

This file was deleted.

13 changes: 8 additions & 5 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ find /var/www -type d -exec chmod 2775 {} +

find /var/www -type f -exec chmod 0664 {} +

# Ensure that overrides are allowed in htaccess Files
# Disable indexes and make attempts to open anything starting with ".git"
# result in a 404 "Not Found" error.

sed -i.previous '/<Directory \"\/var\/www\/html\">/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf
sed -i.previous -e '/<Directory \"\/var\/www\/html\">/,/<\/Directory>/ s/Options Indexes FollowSymLinks/Options -Indexes +FollowSymLinks/' -e '/<Directory \"\/var\/www\/html\">/,/<\/Directory>/ s/AllowOverride None/AllowOverride All\
RedirectMatch 404 \/\\.git/' /etc/httpd/conf/httpd.conf

# Make sure the web server is running
# Make sure the web server is running; restart it if it already is, to ensure
# that it picks up configuration changes we've applied.

echo "Starting HTTP server..."
systemctl start httpd.service
echo "Starting (or restarting) HTTP server..."
systemctl restart httpd.service
systemctl enable httpd.service

# Build, install, and start the turn server
Expand Down

0 comments on commit 27af007

Please sign in to comment.