Difference between revisions of "Hudsonvalley"

From Wiki2
Line 4: Line 4:
  mkdir /etc/apache2/ssl
  mkdir /etc/apache2/ssl
  openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key
  openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key
:2.  
:2. mv phpmyadmin.conf inside a virtual host and put it in sites-available
  mv /etc/apache2/conf.d/phpmyadmin.conf /etc/apache2/sites-available/
  mv /etc/apache2/conf.d/phpmyadmin.conf /etc/apache2/sites-available/
:3. edit take out alias add virtual host, put in new credentials (pem and key)
:3. edit take out alias add virtual host, put in new credentials (pem and key)

Revision as of 11:53, 28 November 2012

securing phpmyadmin

http://paynedigital.com/2011/09/setting-up-and-securing-a-phpmyadmin-install-on-ubuntu-10-04

1. setting up ssl certificate
mkdir /etc/apache2/ssl
openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.key
2. mv phpmyadmin.conf inside a virtual host and put it in sites-available
mv /etc/apache2/conf.d/phpmyadmin.conf /etc/apache2/sites-available/
3. edit take out alias add virtual host, put in new credentials (pem and key)
4. got /etc/apache2/sites-enables and enable it
ln -s ../sites-available/phpmyadmin.conf
5. goto /etc/apache2/ports.conf and add
NameVirtualHost 198.23.156.78:443

moving databases

In phpmyadmin of the target mnachine create a user with same nae as source user and put the source ip as host. Create the (empty)databases on the target

root@10.194.101.169: home$  mysqldump -utim -pnji9ol pathbost_h409 | mysql -h198.23.156.78 -utim -pnji9ol pathbost_h409

To copy directories from old vps to new

root@10.194.101.169: home$  rsync -aHvz /home/pathbost/public_html root@198.23.156.78:/home/pathbost

installed lamp stack using https://help.ubuntu.com/community/ApacheMySQLPHP


Run, Stop, Test, And Restart Apache Use the following command to run Apache :

$ sudo /usr/sbin/apache2ctl start
$ sudo /usr/sbin/apache2ctl stop
$ sudo /usr/sbin/apache2ctl configtest
$ sudo /usr/sbin/apache2ctl restart

Mysql

Commented out # bind-address = 127.0.0.1 in /etc/mysql/my.cnf so as to access db from any server
$ restart mysql