I need some help with this site that I'm currently working on.
So I have multiple database given to me and my task is to migrate it to a host name that I'm given.
Ubuntu 18.04
PHPMYADMIN
MySql
PHP
Apache2
My work:
I create a simple database with username, password and DB name. I created a new site-available .conf file and entered all the details (changed the port and servername to hostName).I then went to PhpmyAdmin and clicked on the newly created database and pressed import. I then imported the database that was given to me. To check If I have the site up, i went to the new host name but All i saw was a default Apache2 page and not the actually site.
From what I know, i think I have to make some configuration changes through Ubuntu Terminal. But I'm not exactly sure how to Migrate it.
So to conclude, I'm given a database and I need to use that database and when I type the hostname, it should have the site running.
Please help.
Update:
I made a directory: /var/www/html/name/wordpress
unzipped it
mysql- u root -p
created the database (db,username,pass)
cd /var/www/html/name/wordpress/
sudo nano wp-config.php
entered all the info exit;
phpMyAdmin
select the newly created database --> import --> used the given database
cd /etc/apache2/sites-available
sudo nano site1.conf
entered the following:
<VirtualHost *:80>
ServerAdmin admin@**NEWHOSTNAME_THAT I WAS GIVEN**
ServerName NEWHOSTNAME_THAT I WAS GIVEN
ServerAlias NEWHOSTNAME_THAT I WAS GIVEN
DocumentRoot /var/www/html/name/wordpress/
<Directory /var/www/html/name/wordpress>
Options FollowSymLinks
Allowoverride None
</Directory>
<Directory /var/www/html/name/wordpress>
Options Indexes FollowSymLinks MultiViews
Allowoverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
Googled: the host name that i was given and in result i get a default apache2 page.
apache2ctl -S
Virtual Host Configuration:
*:80 is a NameVirtualHost
default server (hostname_given) (/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost (hostname_given)(/etc/apache2/sites-enabled/000-default.conf:1)
port 80 namevhost (hostname_given)(/etc/apache2/sites-enabled/000-default.conf:1)
alias (hostname_given)
port 80 namevhost (hostname_given)(/etc/apache2/sites-enabled/000-default.conf:1)
alias (hostname_given)
/etc/apache2/sites-available/your.conf
will be worth. And do not forget tosudo a2ensite your.conf && sudo systemctl reload apache2.service
. – pa4080 Mar 15 '19 at 15:59sudo systemctl estart apache2.service
? If everything is okay on the server side probably you need to flush your browser's cache. On Chrome/Chromium you can useCtrl+Shift+R
. – pa4080 Mar 15 '19 at 17:29sudo a2ensite site1 && sudo systemctl reload apache2.service
– pa4080 Mar 15 '19 at 18:20apache2ctl -S
– DaveStSomeWhere Mar 15 '19 at 18:32