Ubuntu Server Guide Changes, errors and bugs


WordPress Wordpress is a blog tool, publishing platform and CMS implemented in PHP and licensed under the GNU GPLv2. Installation


Download 1.27 Mb.
Pdf ko'rish
bet263/286
Sana20.12.2022
Hajmi1.27 Mb.
#1035308
1   ...   259   260   261   262   263   264   265   266   ...   286
Bog'liq
ubuntu-server-guide

WordPress
Wordpress is a blog tool, publishing platform and CMS implemented in PHP and licensed under the GNU
GPLv2.
Installation
To install WordPress, run the following comand in the command prompt:
sudo apt i n s t a l l w o r d p r e s s
You should also install apache2 web server and mysql server. For installing apache2 web server, please refer
to Apache2 documentation. For installing mysql server, please refer to MySQL documentation.
Configuration
For configuring your first WordPress application, configure an apache site. Open /etc/apache2/sites−
available/wordpress.conf and write the following lines:
A l i a s / b l o g / u s r / s h a r e / w o r d p r e s s

Options FollowSymLinks
A l l o w O v e r r i d e Limi t Options F i l e I n f o
D i r e c t o r y I n d e x i n d e x . php
Order a l l o w , deny
Allow from a l l


Options FollowSymLinks
Order a l l o w , deny
Allow from a l l

Enable this new WordPress site
sudo a 2 e n s i t e w o r d p r e s s
320


Once you configure the apache2 web server and make it ready for your WordPress application, you should
restart it. You can run the following command to restart the apache2 web server:
sudo s y s t e m c t l r e l o a d apache2 . s e r v i c e
To facilitate multiple WordPress installations, the name of this configuration file is based on the Host header
of the HTTP request. This means that you can have a configuration per VirtualHost by simply matching
the hostname portion of this configuration with your Apache Virtual Host. e.g. /etc/wordpress/config-
10.211.55.50.php, /etc/wordpress/config-hostalias1.php, etc.
These instructions assume you can access
Apache via the localhost hostname (perhaps by using an ssh tunnel) if not, replace /etc/wordpress/config-
localhost.php with /etc/wordpress/config-NAME_OF_YOUR_VIRTUAL_HOST.php.
Once the configuration file is written, it is up to you to choose a convention for username and password to
mysql for each WordPress database instance. This documentation shows only one, localhost, example.
Now configure WordPress to use a mysql database. Open /etc/wordpress/config−localhost.php file and write
the following lines:
d e f i n e ( ’DB_NAME’ , ’ wordpress ’ ) ;
d e f i n e ( ’DB_USER’ , ’ wordpress ’ ) ;
d e f i n e ( ’DB_PASSWORD’ , ’ yourpasswordhere ’ ) ;
d e f i n e ( ’DB_HOST’ , ’ l o c a l h o s t ’ ) ;
d e f i n e ( ’WP_CONTENT_DIR’ , ’ / u s r / s h a r e / w o r d p r e s s /wp−c o n t e n t ’ ) ;
?>
Now create this mysql database. Open a temporary file with mysql commands wordpress.sql and write the
following lines:
CREATE DATABASE w o r d p r e s s ;
CREATE USER ’ wordpress ’ @’ l o c a l h o s t ’
IDENTIFIED BY ’ yourpasswordhere ’ ;
GRANT SELECT, INSERT ,UPDATE,DELETE,CREATE,DROP,ALTER
ON w o r d p r e s s . *
TO w o r d p r e s s @ l o c a l h o s t ;
FLUSH PRIVILEGES ;
Execute these commands.
c a t w o r d p r e s s . s q l | sudo mysql −−d e f a u l t s −e x t r a − f i l e =/ e t c / mysql / d e b i a n . c n f
Your new WordPress can now be configured by visiting http://localhost/blog/wp-admin/install.php. (Or
http://NAME_OF_YOUR_VIRTUAL_HOST/blog/wp-admin/install.php if your server has no GUI and
you are completing WordPress configuration via a web browser running on another computer.) Fill out the
Site Title, username, password, and E-mail and click Install WordPress.
Note the generated password (if applicable) and click the login password. Your WordPress is now ready for
use.

Download 1.27 Mb.

Do'stlaringiz bilan baham:
1   ...   259   260   261   262   263   264   265   266   ...   286




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling