1

I'm following the official guide to install WordPress in Ubuntu. I've done a couple things that weren't specified in the guide, because I thought this'd be the best way to do them respecting the guide itself. The first one is creating a new apache2 site and putting the lines suggested in the guide -

    Alias /blog /usr/share/wordpress
    <Directory /usr/share/wordpress>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.php
        Order allow,deny
        Allow from all
    </Directory>
    <Directory /usr/share/wordpress/wp-content>
        Options FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory> 

- Straight after the lines that were already in the file -

<VirtualHost *:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Is this correct or should I put these lines inside the <VirtualHost...>, cos there's nothing specific about where to write those lines, so I assumed it had to go after the preexisting lines, but I feel this information should be included in the guide since it is not, just to make it more clear. Last thing, the last part of the guide says to use the mysql commands to crate a temporary wordpress.sql file, where to write the lines concerning the database infos, but I haven't found anything that says how to create a temporary mysql file using mysql commands... Best I could do was mysql -u root -p but that doesn't create the wordpress.sql temporary file, so I bet someone with more experience could help me figure out and help the community if this kind of issue occurs to anyone else. I would like to follow the official method and none other if possible.

pa4080
  • 29,831

1 Answers1

0

Question 1

Yes suggested lines must be putted inside the <VirtualHost> tags.

Question 2

The mentioned manual suggests to you to create a file, called 'wordpress.sql', which will be used for import of few commands into the MySQL server by these commands:

cat wordpress.sql | sudo mysql --defaults-extra-file=/etc/mysql/debian.cnf

The command cat wordpress.sql will print the content of 'wordpress.sql' to the Standard output (stdout), which will be redirected, by the pipe |, to the Standard input (stdin) of the command mysql, invoked with an argument --defaults.... The command after the pipe will be performed by sudo.

Question 3

The MySQL commands that you need are:

$ mysql -u'root' -p                                                  

mysql> CREATE DATABASE DataBaseName;
mysql> CREATE USER 'DataBaseUser'@'localhost' identified by 'DataBaseUserPassword';
mysql> GRANT ALL PRIVILEGES ON DataBaseName.* TO 'DataBaseUser'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> exit

Where DataBaseName, DataBaseUser and DataBaseUserPassword are subjects of your decision. According to the example the User will be able to access the DataBase only from the localhost, this is enough and safety when Apache and MySQL servers are allocated on the same 'physical' machine. Don't miss the semicolon (;) at the end of each sentence.


Another way how to install WordPress on Ubuntu with LAMP.

pa4080
  • 29,831