Skip to content

Commit 0c81604

Browse files
committed
docs: add ".. code-block:: apache"
1 parent c74535d commit 0c81604

File tree

1 file changed

+57
-43
lines changed

1 file changed

+57
-43
lines changed

user_guide_src/source/installation/running.rst

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,19 @@ The "mod_rewrite" module enables URLs without "index.php" in them, and is assume
106106
in our user guide.
107107

108108
Make sure that the rewrite module is enabled (uncommented) in the main
109-
configuration file, e.g., **apache2/conf/httpd.conf**::
109+
configuration file, e.g., **apache2/conf/httpd.conf**:
110+
111+
.. code-block:: apache
110112
111113
LoadModule rewrite_module modules/mod_rewrite.so
112114
113115
Setting Document Root
114116
---------------------
115117

116118
Also make sure that the default document root's ``<Directory>`` element enables this too,
117-
in the ``AllowOverride`` setting::
119+
in the ``AllowOverride`` setting:
120+
121+
.. code-block:: apache
118122
119123
<Directory "/opt/lamp/apache2/htdocs">
120124
Options Indexes FollowSymLinks
@@ -132,7 +136,9 @@ Enabling vhost_alias_module
132136
---------------------------
133137

134138
Make sure that the virtual hosting module is enabled (uncommented) in the main
135-
configuration file, e.g., **apache2/conf/httpd.conf**::
139+
configuration file, e.g., **apache2/conf/httpd.conf**:
140+
141+
.. code-block:: apache
136142
137143
LoadModule vhost_alias_module modules/mod_vhost_alias.so
138144
@@ -151,7 +157,9 @@ Setting VirtualHost
151157
-------------------
152158

153159
Add a ``<VirtualHost>`` element for your webapp inside the virtual hosting configuration,
154-
e.g., **apache2/conf/extra/httpd-vhost.conf**::
160+
e.g., **apache2/conf/extra/httpd-vhost.conf**:
161+
162+
.. code-block:: apache
155163
156164
<VirtualHost *:80>
157165
DocumentRoot "/opt/lamp/apache2/htdocs/myproject/public"
@@ -179,60 +187,66 @@ The following assumes that the server is already configured for mod_userdir. A g
179187

180188
Because CodeIgniter4 expects the server to find the framework front controller at **public/index.php** by default, you must specify this location as an alternative to search for the request (even if CodeIgniter4 is installed within the per-user web directory).
181189

182-
The default user web directory **~/public_html** is specified by the ``UserDir`` directive, typically in **apache2/mods-available/userdir.conf** or **apache2/conf/extra/httpd-userdir.conf**::
190+
The default user web directory **~/public_html** is specified by the ``UserDir`` directive, typically in **apache2/mods-available/userdir.conf** or **apache2/conf/extra/httpd-userdir.conf**:
191+
192+
.. code-block:: apache
183193
184194
UserDir public_html
185195
186-
So you will need to configure Apache to look for CodeIgniter's public directory first before trying to serve the default::
196+
So you will need to configure Apache to look for CodeIgniter's public directory first before trying to serve the default:
197+
198+
.. code-block:: apache
187199
188200
UserDir "public_html/public" "public_html"
189201
190-
Be sure to specify options and permissions for the CodeIgniter public directory as well. A **userdir.conf** might look like::
202+
Be sure to specify options and permissions for the CodeIgniter public directory as well. A **userdir.conf** might look like:
203+
204+
.. code-block:: apache
191205
192206
<IfModule mod_userdir.c>
193207
UserDir "public_html/public" "public_html"
194208
UserDir disabled root
195209
196210
<Directory /home/*/public_html>
197-
AllowOverride All
198-
Options MultiViews Indexes FollowSymLinks
199-
<Limit GET POST OPTIONS>
200-
# Apache <= 2.2:
201-
# Order allow,deny
202-
# Allow from all
203-
204-
# Apache >= 2.4:
205-
Require all granted
206-
</Limit>
207-
<LimitExcept GET POST OPTIONS>
208-
# Apache <= 2.2:
209-
# Order deny,allow
210-
# Deny from all
211-
212-
# Apache >= 2.4:
213-
Require all denied
214-
</LimitExcept>
211+
AllowOverride All
212+
Options MultiViews Indexes FollowSymLinks
213+
<Limit GET POST OPTIONS>
214+
# Apache <= 2.2:
215+
# Order allow,deny
216+
# Allow from all
217+
218+
# Apache >= 2.4:
219+
Require all granted
220+
</Limit>
221+
<LimitExcept GET POST OPTIONS>
222+
# Apache <= 2.2:
223+
# Order deny,allow
224+
# Deny from all
225+
226+
# Apache >= 2.4:
227+
Require all denied
228+
</LimitExcept>
215229
</Directory>
216230
217231
<Directory /home/*/public_html/public>
218-
AllowOverride All
219-
Options MultiViews Indexes FollowSymLinks
220-
<Limit GET POST OPTIONS>
221-
# Apache <= 2.2:
222-
# Order allow,deny
223-
# Allow from all
224-
225-
# Apache >= 2.4:
226-
Require all granted
227-
</Limit>
228-
<LimitExcept GET POST OPTIONS>
229-
# Apache <= 2.2:
230-
# Order deny,allow
231-
# Deny from all
232-
233-
# Apache >= 2.4:
234-
Require all denied
235-
</LimitExcept>
232+
AllowOverride All
233+
Options MultiViews Indexes FollowSymLinks
234+
<Limit GET POST OPTIONS>
235+
# Apache <= 2.2:
236+
# Order allow,deny
237+
# Allow from all
238+
239+
# Apache >= 2.4:
240+
Require all granted
241+
</Limit>
242+
<LimitExcept GET POST OPTIONS>
243+
# Apache <= 2.2:
244+
# Order deny,allow
245+
# Deny from all
246+
247+
# Apache >= 2.4:
248+
Require all denied
249+
</LimitExcept>
236250
</Directory>
237251
</IfModule>
238252

0 commit comments

Comments
 (0)