Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit bad4907

Browse files
committed
ISSUE 29: Review of sed commands.
1 parent 7154889 commit bad4907

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ RUN rpm --rebuilddb \
2525
# Apache mime_magic module should be disabled with FastCGI
2626
# -----------------------------------------------------------------------------
2727
RUN sed -i \
28-
-e 's~^LoadModule mime_magic_module modules/mod_mime_magic.so~#LoadModule mime_magic_module modules/mod_mime_magic.so~g' \
28+
-e 's~^LoadModule mime_magic_module ~#LoadModule mime_magic_module ~g' \
2929
/etc/httpd/conf/httpd.conf
3030

3131
# -----------------------------------------------------------------------------
3232
# Enable the pathinfo fix
3333
# -----------------------------------------------------------------------------
3434
RUN sed -i \
35-
-e 's~^;cgi.fix_pathinfo=1~cgi.fix_pathinfo = 1~g' \
35+
-e 's~^;cgi.fix_pathinfo=1$~cgi.fix_pathinfo=1~g' \
3636
/etc/php.ini
3737

3838
# -----------------------------------------------------------------------------

etc/apache-bootstrap

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,29 @@ fi
101101

102102
# Set the Apache (run) service user/group
103103
if [[ ${OPTS_SUEXECUSERGROUP} == true ]]; then
104-
sed -i -e "s~^User .*$~User ${OPTS_SERVICE_USER_GROUP}~g" \
105-
-e "s~^Group .*$~Group ${OPTS_SERVICE_USER_GROUP}~g" /etc/httpd/conf/httpd.conf
106-
sed -i -e 's~#SuexecUserGroup \(.*\)$~SuexecUserGroup \1~g' ${OPTS_APP_HOME_DIR}/vhost.conf
107-
sed -i -e 's~#SuexecUserGroup \(.*\)$~SuexecUserGroup \1~g' ${OPTS_APP_HOME_DIR}/vhost-ssl.conf
104+
sed -i \
105+
-e "s~^User .*$~User ${OPTS_SERVICE_USER_GROUP}~g" \
106+
-e "s~^Group .*$~Group ${OPTS_SERVICE_USER_GROUP}~g" \
107+
/etc/httpd/conf/httpd.conf
108+
sed -i \
109+
-e 's~#SuexecUserGroup \(.*\)$~SuexecUserGroup \1~g' \
110+
-e 's~app/bin/php-wrapper~app-bin/php-wrapper~g' \
111+
${OPTS_APP_HOME_DIR}/vhost.conf \
112+
${OPTS_APP_HOME_DIR}/vhost-ssl.conf
108113
chown -R 502:502 /var/{www/app-bin,run/mod_fcgid}
109114
else
110-
sed -i -e "s~^User .*$~User apache~g" \
111-
-e "s~^Group .*$~Group apache~g" /etc/httpd/conf/httpd.conf
112-
sed -i -e 's~\([^#]\)SuexecUserGroup \(.*\)$~\1#SuexecUserGroup \2~g' ${OPTS_APP_HOME_DIR}/vhost.conf
113-
sed -i -e 's~\([^#]\)SuexecUserGroup \(.*\)$~\1#SuexecUserGroup \2~g' ${OPTS_APP_HOME_DIR}/vhost-ssl.conf
115+
sed -i \
116+
-e "s~^User .*$~User apache~g" \
117+
-e "s~^Group .*$~Group apache~g" \
118+
/etc/httpd/conf/httpd.conf
119+
sed -i \
120+
-e 's~\([^#]\)SuexecUserGroup \(.*\)$~\1#SuexecUserGroup \2~g' \
121+
-e 's~app/bin/php-wrapper~app-bin/php-wrapper~g' \
122+
${OPTS_APP_HOME_DIR}/vhost.conf \
123+
${OPTS_APP_HOME_DIR}/vhost-ssl.conf
114124
chown -R apache:apache /var/{www/app-bin,run/mod_fcgid}
115125
fi
116126

117-
# Update any existing instances of php-wrapper path in the Virtual Host
118-
sed -i -e 's~app/bin/php-wrapper~app-bin/php-wrapper~g' ${OPTS_APP_HOME_DIR}/vhost.conf
119-
sed -i -e 's~app/bin/php-wrapper~app-bin/php-wrapper~g' ${OPTS_APP_HOME_DIR}/vhost-ssl.conf
120-
121127
echo "Loading Apache modules."
122128
for MODULE in ${APACHE_LOAD_MODULES}; do
123129
echo " - ${MODULE}"

0 commit comments

Comments
 (0)