Monthly Archives: August 2016

Add on User, Domain and SFTP

Last night very successfully added a new user to my VestaCP for frihouse.net.  However then found that I couldn’t use the SFTP feature for the new user to upload files in FileZilla.  If I were to use VestaCP for multiple users, I would have to enable FTP.  Or do I?  It’s what happened anyway.  Question for this lesson is, how to allow a new user to upload files through SFTP when there is no FTP server?

Found this solution at VestaCP Forum – for testing:

https://forum.vestacp.com/viewtopic.php?t=4051

and

http://www.herethere.net/~samson/rssh_chroot.html

Need to test this.

I also made a mistake, and hope I will remember it.  When I add on a new domain I have to enable child template for the Name DNS Server.  Otherwise the domain will just redirect to frihouse.net.  Important lesson to remember.

Jonradio Private Site Plugin

Two days ago discovered a great plugin for making a site private. I was looking for something where one can set up members oneself, without opening the Website for everyone to register.

The Jonradio Private Plugin works perfect! I get to set up the member in WordPress, and it then sends an e-mail to the user to set up a password. One can choose different levels for membership. Subscriber is profile only. Contributor can add posts and edit the posts the contributor added only. Then Editor can add all posts and pages.

Here is a link to the plugin:
https://wordpress.org/plugins/jonradio-private-site/

 

Add on Domain Success

So after the successful second installation of VestaCP decided it was time to test an add on domain. I was wondering whether there would be any challenges with DNS. I was blown away by how easy and smooth all of it went. Part of it may be that VPS 27 is a very fast VPS. And VestaCP is also a lightweight fast panel. I’d purchased one of those cheap domains at Namecheap earlier in the day. Then added my frihouse.net name servers to it. It was very easy to add on a domain in VestaCP, only thing to make sure in the DNS setup is to set it on a child template. Not the default template.

I then experimented with copying the WordPress Website on frihouse.net to the add on domain. I first created an empty database. Then uploaded the frihouse.net database to the new database in phpmyadmin. That went super fast. Then used FileZilla to SFTP a fresh installation of WordPress to the new add on domain. Also added the plugins, themes and uploaded artwork to the new installation in the add on domain. All that was left to do was to sort out the domain information in the database and config.php of WordPress, and it worked perfect. One final tweak was to give permission to the new add on domain to own the public_html of the new add on domain. Totally blew me away how fast all of that went. Like under 20 minutes.

Second VestaCP Installation

So had a second opportunity for a VestaCP installation with a new VPS that I received from freevps.us. Fantastic VPS called VPS27, courtesy of the admin and staff of freevps.us and GalaxyHostPlus. Specs of the VPS are:

Disk Size: 50 GB
Monthly Traffic: 1 TB
Memory: 1 GB
IP Addresses: 1x IPv4 & /80 IPv6
Virtualization: KVM
Location: Frankfurt, Germany
Control Panel: SolusVM
Connection: 1 Gbit/s

I was obviously more experienced with the second installation of VestaCP, however phpmyadmin gave me another big hurdle. Think I got mixed up with the tutorial that I was following and the patch that is provided for the configuration of phpmyadmin. As with the first installation, it was easy to install the database. I then did things different, wondering whether just the patch provided by VestaCP would be OK on its own. Then after that set up the configuration file by using the one that was provided by the tutorial, and think that is where I blundered. At any rate, I then ended up with lots of errors. Tried to follow the tutorial by uploading a new phpmyadmin database, creating user, etc as well as tables. That also resulted in errors. Finally I went back to the VestaCP patch and tried both versions that were provided. Then copied the configuration file for dhsites.net to frihouse.net. And finally it worked.

The DNS worked flawlessly for the second installation as well. I found that I had to add permission for frihouse.net to own WordPress. So at least now know a few of the VestaCP quirks, and was able to negotiate all of them. Wish I could be a little more sure of the steps for phpmyadmin. At least I know it’s a challenge, and after a bit of struggles have been able to get past it.

Installation Commands for VestaCP

VestaCP provides an excellent “menu” for choosing what one wants to include in VestaCP in ONE installation command.  All one needs to do is navigate to its main page and you will find a menu with some default settings as well as options for the settings with which to  output ONE Installation Command.

Capture

The default Install Command will then look something like this:

bash vst-install.sh –nginx yes –apache yes –phpfpm no –vsftpd yes –proftpd no –exim yes –dovecot yes –spamassassin yes –clamav yes –named yes –iptables yes –fail2ban yes –mysql yes –postgresql no –remi yes –quota no

I wanted the lightest possible VestaCP for a beginner VPS.  I was planning to use the VPS as a single user, i.e. not allocate hosting accounts, so then elected not to install an FTP server.  VestaCP of course doesn’t come with a free File Manager, however I’m quite happy with FileZilla and decided to go with SFTP instead of FTP. I also decided not to install a mail server as it is easy if not used expertly for it to be vulnerable for exploits.  If mail is needed with my domain later on, I was planning to use a free e-mail host like Zoho or Yandex.  Yandex in particular is very generous with the number of e-mail accounts that are allowed for use with one’s domain.

Initially I thought to go for no DNS either, but soon found that to be a problem, so did a second install where I selected “named” for installation of a Bind Server.  I assumed that if I selected Remi for the Repository that that would make it easier to update VestaCP.  For the hostname I had to think what it should be, and then thought to go with vps.domain.tld, but in hindsight should only have gone with domain.tld.  It was easy to remedy though, as soon as my Panel was up, I created a new domain with domain.tld, and deleted the vps.domain.tld.  I don’t know much about fail2ban, but thought it could only be good to have, so still have to study how it works.

My choices for the Install Command were:

WEB:  nginx + apache
FTP:  No
MAIL: No
DNS: I first tried “NO”, but then reinstalled and selected “Named” – I needed the DNS
FIREWALL:  iptables + fail2ban
DB:  mySQL
REPOSITORY: Remi
FILE SYSTEM QUOTA: No
HOSTNAME:   vps.domain.tld – next time domain.tld

In summary these are the commands I used once I accessed my new VPS with PuTTY (note my VPS host installed a minimal CentOS-6-X86 on my VPS):

yum -y update
yum install wget ( didn’t really need it as it was already there)
yum -y install curl (didn’t really need it as it was already there)
curl -O http://vestacp.com/pub/vst-install.sh
bash vst-install.sh –nginx yes –apache yes –phpfpm no –vsftpd no –proftpd no –exim no –dovecot no –spamassassin no –clamav no –named yes –iptables yes –fail2ban yes –mysql yes –postgresql no –remi yes –quota no –hostname vps.domain.tld –email name@yahoo.com –password 123456

 

 

 

My PhpMyAdmin HURDLE!

After breezing through an easy VestaCP installation including almost instant DNS propagation I was more than ready to install a WordPress site.  I first tried to use my Duplicator Migration Installer, was delighted when the Installer.php worked, however everything else in VestaCP failed for the Duplicator Tool.  I soon realized that I’d have to copy the WordPress site the difficult way by first creating a database.

Adding a database in VestaCP is dead easy, however the fun started when after the addition the next step took me to PhpMyAdmin that was filled with error messages.  That was when I realized I needed some extra help with the configuration of PhpMyAdmin.  During my preparation before the install I had happened upon a YouTube tutorial and I used this in detail for setting up my PhpMyAdmin.

First step was to go into PhpMyAdmin as ROOT and I’d completely forgotten what my VestaPanel ROOT password was.  Initially I thought it was my VPS ROOT password, but not so.  Fortunately I was able to find it at this location:

etc/phpmyadmin/config.inc.php

Then of course bashed my head against the wall a few times as the password had been so obvious.

I was finally as Root in PhpMyAdmin and was able to follow the steps in the cheat sheet that was provided for Configuring PhpMyAdmin:

  • Add a new user
  • Keep drop boxes in window unticked – no privileges as yet
  • Create database with same name but with privileges
  • Check “global privileges” and tick all
  • Then hit “GO”
  • Import create_tables.sql.gz from a zipped folder provided by author
  • Log out of PhpMyAdmin
  • Edit config.inc.php (from zipped folder) changing name of user and password
  • Upload config.inc.php to /etc/phpmyadmin/config.inc.php
  • Log into PhpMyAdmin again as root

At this stage PhpMyAdmin was supposed to be error free.  Except there were still bugs in it.  The three last tables were disabled, and when I Googled it just couldn’t find an answer.  Was well and truly stuck until I found a solution by the VestaCP Team, which was the following patch:

wget –no-check-certificate https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-centos.sh && chmod +x pma-centos.sh && ./pma-centos.sh

I was happy to read these words by Skurudo (VestaCP Guru):

adds in a mysql pma user / and the table phpmyadmin (if the user “pma” or the table “phpmyadmin” already exists, the script will delete those!);

It worked!  Next I was able to log in as the user of the Database I had created before I had started the PhpMyAdmin configuration (felt like ages before) and to import the WordPress site dbase.sql.

Mission accomplished!

SFTP WordPress Lesson

So last night spent hours trying to figure out why WordPress asks for FTP details when I want to load plugins or delete themes.  My searches first took me to WordPress.org where I worked through a large number of posts.  The suggestion that looked like a good one was to force the issue with the following addition to the wp-config.php:

define(‘FS_METHOD’,’direct’);

Initially that made me happy as on the face of it it looked as though it was working.  There was no request for FTP details, and when I attempted to delete a theme, it said it was “successfully” deleted, except the theme was still there.  When I tried to reinstall WordPress it attempted to install and looked as though it was doing something until it was obvious  it wasn’t.  WordPress Codex suggested by way of an alternative that “direct” could be replaced with “ssh2” or “ftpext” or “ftpsockets” in that order, however that didn’t work either.  WP reverted back to asking for FTP details again.

Next I navigated to the VestaPanel Community Forum and soon realized that the problem was unique to VestaPanel users – there were a good number of posts discussing the issue.  I was finally able to grasp that the owner of my WordPress installation was ROOT and not ADMIN and that was the reason WordPress was asking for FTP details.  When I had installed my VestaCP I had made a decision not to install an FTP server and to use SFTP .  Which in essence meant that ROOT and not ADMIN was the owner of my WordPress installation.  WordPress was looking for ROOT and since ADMIN didn’t have user privileges it asked for FTP details.  So found the following commands that I will be trying out tonight when I get home:

cd /home/admin/web/domain.tld/public_html/
chown admin -R *

Cross fingers it will work out.  If it does, then this is an important lesson for those with VestaPanel who elect to use SFTP instead of installing an FTP Server.

Note: It did work!  If one doesn’t install an FTP server and one uses SFTP one in effect installs scripts on public_html as ROOT.  One has to give ADMIN ownership of public_html otherwise it will have issues such as with WordPress.  The WordPress site I created is in perfect shape now.  Have to marvel at the speed of the site, especially when I’m working on it.  Probably a combo of VestaPanel as well as VPS speed.  Am very happy with the outcome!

VestaCP Up and Running!

I’m a VestaCP Admin now!  Really pleased with how things turned out. I had a domain and WordPress Website up and running within three hours of installation.  Granted I researched the steps almost to death in advance but I’m happy with my progress so far.  Sorting out phpmyadmin took most of the three hours, otherwise the WordPress site could have been up and running within 30 minutes.

The first hurdle I thought I may have difficulties with was the DNS, but that went like a breeze.  Probably because I’d already created name servers for my Domain at Namecheap and the DNS had already propagated.  Only tiny hurdle I had to sort out was finding where the packages were so I could add my domain name servers, and as usual it was staring me right in the face.  It was on top!

Next DNS issue that puzzled me a little was VestaCP created a domain with vps.domain.com.  Whereas it should have been domain.com.  So think I’m going to experiment with setting up VestaCP with domain.com instead of vps.domain.com from scratch to test it.  In this case I added a new domain called domain.com, and then deleted the vps.domain.com.  However think this could potentially create conflicts, so want to test that out.

The next challenge turned into quite a big one, i.e. the phpmyadmin configuration.  I had followed all the steps from a tutorial I’d found in YouTube, but it didn’t quite work out.  Then when I Googled for a solution I lucked out on a script from VestaCP for sorting out phpmyadmin, which I promptly installed, and that seemed to have sorted everything out.  I was impressed with the script as it deleted everything that needed to be deleted, so I didn’t need to figure out what needed to be deleted first. So now I am not quite sure which part was responsible for the success or whether it was a partial success on both sides.  Think I need to rerun everything tonight, to see for myself whether the script can stand on its own.

Once VestaCP phpmyadmin was set up and running, I was able to load a WordPress site.  First I tried my Duplicator Installer but that didn’t work at all.  Next I downloaded a fresh installation of WordPress and SFTP’d the new installation files to the domain public.html.  Then created a new database to which I imported the .sql file of the WordPress site.  Everything went well except for WordPress asking for ftp details every time I wanted to upload a plugin or theme.  That took hours to troubleshoot. Since I didn’t want to leave the site unprotected I uploaded all of the plugins by SFTP.  There is always more than one way to do anything.  Took me a long while, but in the end I had a perfect clone of a working WordPress site running on my VPS.

All in all I feel well satisfied with VestaCP and my spiffy new VPS from HostUS.  Speed is unbelievably fast compared with my two other VPSs.  I think I’ve found a great VPS home.