install:apache
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
install:apache [2018-03-22 09:54] – beimak | install:apache [2023-10-27 13:40] (current) – 80.125.1.180 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Apache ====== | ====== Apache ====== | ||
- | - Create '' | + | [[https://httpd.apache.org/|Apache]] is the most widely used webserver |
- | - Link < | + | |
- | lrwxrwxrwx 1 root root 25 Apr 5 2014 dokuwiki.conf -> / | + | |
- | - Enable | + | |
- | - Restart / Reload apache | + | |
- | - Setup [[: | + | |
- | ===== / | ||
- | (APACHE2.4 you can new file in Includes e.g. wiki.conf) | ||
- | * change '' | + | ===== Installation ===== |
- | < | + | Basically all Linux distributions offer an Apache package for easy installation. Please refer to your distribution' |
- | AliasMatch ^/ | + | |
- | AliasMatch ^/ | + | |
- | Alias / | + | |
- | < | + | Windows user can pick installation packages from various [[https://httpd.apache.org/docs/current/ |
- | Options +FollowSymLinks | + | |
- | require all granted | + | |
- | ##VER APACHE2.4 | + | |
- | Allow from localhost 127.0.0.1 | + | |
- | < | + | FIXME MacOS? |
- | # Uncomment to implement server-side URL rewriting | + | ===== Adding PHP support ===== |
- | # (cf. < | + | |
- | # Do *not* mix that with multisite! | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | </ | + | |
- | </ | + | |
- | < | + | PHP can be added through mod_php or fpm. |
- | Require all denied | + | |
- | ##FOR VER APACHE2.4 | + | |
- | </ | + | |
- | < | + | FIXME add info |
- | | + | |
- | ##FOR VER APACHE2.4 | + | ===== Enabling .htaccess Support ===== |
- | </Directory> | + | |
+ | [[wp> | ||
+ | |||
+ | FIXME add info | ||
+ | |||
+ | See also: [[https://stackoverflow.com/questions/8551740/ | ||
+ | |||
+ | ===== Rewriting for nicer URLs ===== | ||
+ | |||
+ | To enable [[: | ||
+ | |||
+ | sudo a2enmod rewrite | ||
+ | sudo apache2ctl restart | ||
+ | |||
+ | Rewrite rules can then be configured on a per vhost base or via a '' | ||
+ | |||
+ | Dokuwiki comes with a distribution copy of the [[wp>.htaccess]]-file called '' | ||
+ | |||
+ | Here is an example how the rewrite rules should look like. | ||
+ | |||
+ | <code apache> | ||
+ | RewriteEngine on | ||
+ | |||
+ | RewriteBase /dokuwiki | ||
+ | |||
+ | RewriteRule ^_media/ | ||
+ | RewriteRule ^_detail/ | ||
+ | RewriteRule ^_export/ | ||
+ | RewriteRule ^$ doku.php | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteRule (.*) doku.php? | ||
+ | RewriteRule ^index.php$ | ||
</ | </ | ||
+ | Please note that the line '' | ||
+ | |||
+ | B flag is required from apache 2.4.56 in order to avoid error '' | ||
+ | |||
+ | ==== Apachectl status broken ==== | ||
+ | |||
+ | Dokuwiki rewrite rules can affect the //apachectl status// command and make it return a DokuWiki 404 page instead of the server-status page. You can fix that by either adding an exception to the rewrite rules | ||
+ | |||
+ | <code apache> | ||
+ | RewriteCond %{REQUEST_URI} !^/ | ||
+ | </ | ||
+ | |||
+ | or creating an empty server-status file in dokuwiki root folder where doku.php is located. | ||
+ | |||
+ | See forum post [[http:// | ||
- | ====== Nice URLs using the .htaccess setting ====== | ||
- | Dokuwiki comes with a distribution copy of the [[wp> | ||
- | # | ||
- | Remove the hash to uncomment the line: | ||
- | RewriteEngine on | ||
- | Uncommenting the lines will create a set of substitutions which the web server will make in order to format nice urls. | + | ==== See Also ==== |
- | The next thing you need to do is to enable apache' | ||
- | sudo a2enmod rewrite | ||
- | This will update the configuration files; then you must restart the server: | ||
- | sudo service apache2 restart | ||
- | It should be noted that if ever the '' | ||
- | sudo / | ||
- | You must always use '' | + | * [[https:// |
install/apache.1521708899.txt.gz · Last modified: 2018-03-22 09:54 by beimak