User Tools

Site Tools


wordpress:install_wordpress

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wordpress:install_wordpress [2016/10/18 21:46] peterwordpress:install_wordpress [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 170: Line 170:
  
 This will allow the web server to create files and directories under this directory, which will permit us to upload content to the server. This will allow the web server to create files and directories under this directory, which will permit us to upload content to the server.
 +
 +
 +===== Modify Nginx Server Blocks =====
 +
 +If using Apache, just ignore this entire paragraph.
 +
 +We have our files and directories configured.  Now we need to modify our nginx configuration to serve the content correctly.
 +
 +We can use the default nginx server block as a base for our new server block.  Copy it over like this:
 +
 +<code bash>
 +sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/wordpress
 +</code>
 +
 +Open the new file we made so that we can make some changes:
 +
 +<code bash>
 +sudo vi /etc/nginx/sites-available/wordpress
 +</code>
 +
 +We will want to make the following changes:
 +
 +<file nginx /etc/nginx/sites-available/wordpress>
 +server {
 +        listen 80 default_server;
 +        listen [::]:80 default_server ipv6only=on;
 +
 +        root /var/www/html;
 +        index index.php index.html index.htm;
 +
 +        server_name your_domain.com;
 +
 +        location / {
 +                # try_files $uri $uri/ =404;
 +                try_files $uri $uri/ /index.php?q=$uri&$args;
 +        }
 +
 +        error_page 404 /404.html;
 +
 +        error_page 500 502 503 504 /50x.html;
 +        location = /50x.html {
 +                root /usr/share/nginx/html;
 +        }
 +
 +        location ~ \.php$ {
 +                try_files $uri =404;
 +                fastcgi_split_path_info ^(.+\.php)(/.+)$;
 +                fastcgi_pass unix:/var/run/php5-fpm.sock;
 +                fastcgi_index index.php;
 +                include fastcgi_params;
 +        }
 +}
 +</file>
 +
 +A summary of changes that you should be making are:
 +
 +  * Change the value of the **root** directive to point to our new document root at **/var/www/html**.
 +  * Modify the **index** parameter to look for an **index.php** file before the other files.
 +  * Change the value of the **server_name** directive to point to your server's domain name or IP address.
 +  * Adjust the **try_files** within the **location /** block to send requests to PHP when they do not exactly match.
 +
 +Some of these might already be set from your LEMP installation.  When you are finished with these changes, save and close the file.
 +
 +We need to link our new file to the **sites-enabled** directory in order to activate it.  We can do that like this:
 +
 +<code bash>
 +sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/
 +</code>
 +
 +
 +The file we just linked conflicts with our old default file, since it borrowed so much from it.  We need to disable the old file:
 +
 +<code bash>
 +sudo rm /etc/nginx/sites-enabled/default
 +</code>
 +
 +Now, restart the web server and PHP processor to enable our changes:
 +
 +<code bash>
 +sudo service nginx restart
 +sudo service php5-fpm restart
 +</code>
  
  
Line 184: Line 266:
 You will see the WordPress initial configuration page, where you will create an initial administrator account: You will see the WordPress initial configuration page, where you will create an initial administrator account:
  
-{{:wordpress:wordpress_initial_config.png?600 |}}+{{:wordpress:wordpress_initial_config.png|}}
  
 Fill out the information for the site and the administrative account you wish to make.  When you are finished, click on the install button at the bottom. Fill out the information for the site and the administrative account you wish to make.  When you are finished, click on the install button at the bottom.
Line 194: Line 276:
 Hit the button at the bottom and then fill out your account information: Hit the button at the bottom and then fill out your account information:
  
-{{ :wordpress:wordpress_login.png|}}+{{:wordpress:wordpress_login.png|}}
  
 You will be presented with the WordPress interface: You will be presented with the WordPress interface:
  
-{{ :wordpress:wordpress_admin_interface.png?600 |}}+{{:wordpress:wordpress_admin_interface.png|}}
  
  
-===== Configure Pretty Permalinks for WordPress (Optional) =====+===== Configure Apache Pretty Permalinks for WordPress (Optional) ===== 
 + 
 +If using NginX then either ignore this entire section or adjust accordingly.
  
 By default, WordPress creates URLs dynamically that look something like this: By default, WordPress creates URLs dynamically that look something like this:
Line 293: Line 377:
 On the left-hand side, under the Settings menu, you can select Permalinks: On the left-hand side, under the Settings menu, you can select Permalinks:
  
-{{ :wordpress:wordpress_perma_settings.png?600 |}}+{{:wordpress:wordpress_perma_settings.png|}}
  
 You can choose any of the preconfigured settings to organize URLs, or you can create your own. You can choose any of the preconfigured settings to organize URLs, or you can create your own.
  
-{{ :wordpress:wordpress_perma_options.png?600 |}}+{{:wordpress:wordpress_perma_options.png|}}
  
 When you have made your selection, click "Save Changes" to generate the rewrite rules. When you have made your selection, click "Save Changes" to generate the rewrite rules.
Line 303: Line 387:
 If you allowed the web server write access to your .htaccess file, you should see a message like this: If you allowed the web server write access to your .htaccess file, you should see a message like this:
  
-{{ :wordpress:wordpress_perma_update.png?600 |}}+{{:wordpress:wordpress_perma_update.png|}}
  
 If you did not allow the web server write access to your .htaccess file, you will be provided with the rewrite rules you need to add to the file manually. If you did not allow the web server write access to your .htaccess file, you will be provided with the rewrite rules you need to add to the file manually.
Line 311: Line 395:
 <code bash> <code bash>
 vi /var/www/html/.htaccess vi /var/www/html/.htaccess
-</bash>+</code>
  
 This should give you the same functionality. This should give you the same functionality.
Line 324: Line 408:
  
 https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04 https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04
 +
 +https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04
  
wordpress/install_wordpress.1476827165.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki