4 posts / 0 new
Last post
#1 Sun, 06/04/2017 - 09:31
thesoundandfury

Lost

Sorry if this sounds like begging.

I've been struggling for days to get this running and I'm not sure what i'm doing wrong.

I'm tying to setup a PHP site I've made.

I have Virtualmin setup on my VPS.

I have my domain pointed towards my nameservers which I setup with my VPS IP address.

My questions I guess would be,

  1. Do I need to use BOTH Virtualmin AND Webmin? Or can I setup everything with Virtualmin?

  2. How do I setup Mysql on Virtualmin? I have my database setup in Webmin, but do I need to link them somehow?

  3. How do I use ftp to connect to my Virtualmin file directory?

Sorry about all the questions, this is my first time doing anything like this.

Sun, 06/04/2017 - 13:26
unborn
unborn's picture

hi,

  1. virtualmin is part of the webmin and its sort of running on top of the webmin, so yes you need them both. webmin is for system administration more or less and virtualmin is for web stuff administration (if I understand it correctly).
  2. mysql should be setup directly and mysql server should be in webmin menu - if you prefer to use something like phpmyadmin, go to virtualmin tab, select primary domain or domain you would like to use for accessing your phpmyadmin and in menu click install scripts - select phpmyadmin and install it, then you can access it via yourdomain.com/phpmyadmin, otherwise you can use it directly in webmin module.
  3. just enable ftp in main virtualmin menu (scroll down a bit and you will see whats running and what is not) - personally I do not use ftp at all - ssh is best.

I hope so it helps.

Configuring/troubleshooting Debian servers is always great fun

Sun, 06/04/2017 - 13:46
Dibs

I'm making a few assumptions here:

  • The "site" is related to one domain. Or at least you want the other "versions" mirroring it. i.e. Your domain is somedomain.com and you want somedomain.net and similar to all point to it.

  • You have virtualmin installed at the "base" level. By that I mean if you go to https://yourVPSip:10000 it takes you to the Virtualmin login.

OK - here's my thoughts on getting your site up and running:

Create a virtual server. Put your domain name in at the top, skip the description, put a password in for the admin & here's what I do - put a custom username in for the Admin. Call it what you like. That effectively ends up being the "master" user for your domain.

In the Enabled features section - I'd untick everything except "Setup Website for Domain" & "Create MySQL database".

Click the Create Server button. You 'll see some progress messages - everything should be successful. Now if you look in the left pane - you should see your newly created virtual server.

Now that's the basics of creating a VirtualServer.

Now you'll have a database associated with your VirtualUser - you'll see this if you look in Webmin - Servers - MySQLDatabase server.

I've tinkered with permissions and a few other things here and each time things didn't work. Then one time I noticed the little "advisory" msg in the screen asking me not to mess with SQL Permissions via webmin as it might annoy Virtualmin and could - was in my case - cause issues.

You want to manage your MySQL Database? Make sure your VirtualServer is in the dropdown box and click on Install Scripts below it.

Put a tick in phpMyAdmin and click on Install Options - Leave stuff at default and click Install Now.

You shouldn't have issues here - if you do report back. Make note of any passwords it might spit out about the MySQL user or something. I can vaguely remember something popping up.

Now you can go to your website www.yourdomain.com/phpmyadmin

and you should get a login prompt. You should have the login & password. Restore your database. If it's your first rodeo with phpMyAdmin - Google "phpMyadmin restore database" and you should have some good walkthroughs with pictures. Even Google "phpMyAdmin backup database".

Now the last bit. FTP. Assuming you're on Windows or similar. I like Filezilla - Google it and download and install. You'll only need your admin user & password that you created when you created the VirtualServer earlier. For FTP to login - you only need really 3 things

IP or a hostname - go with IP less to worry about User - your admin user (or any other user with FTP rights but let's not complicate matters) Password - your admin use password.

It's a drag and drop interface.

Worst case scenario - in Virtualmin, delete the virtual server. This will remove any files you've FTP'd, any mySQL databases you created and any users. Get comfortable with stuff. Have a play.

Once you've got the php files FTP'd and the mySQL db restored and your site works as it should - wipe it down and try again. This time maybe enabling mail for domain, assuming you want emails at this domain. [You don't have to but get comfortable!!]

Dibs.

p.s. You wrote "I have my domain pointed towards my nameservers which I setup with my VPS IP address."

Why don't you go to your Registrar's control panel and use their nameservers for now and in the DNS bit put in a single @ entry pointing to your VPS IP address and a www entry pointing to the @. Keep stuff simple without bringing in the whole "manage your own DNS"?

Mon, 06/05/2017 - 13:20
ksihota
  1. if you do not want to bother installing phpMyAdmin you can use the Database tool in Virtualmin. It took me a while to figure out how to upload an sql file but once you know its pretty easy
  1. Access Edit Databases under Virtualmin
  2. Create a new database or select Manage on the right of the existing one
  3. On the Edit Database form find the Execute SQL button (bottom right) and select it
  4. Select the Tab Run SQL from file
  5. Select from uploaded file (then upload your SQL file)
  6. Select the Execute button

Your SQL file will create the necessary tables and populate the tables with the data in the file. You can change password or name from the main Edit Databases form and you can manage tables and data from the Manage database form. If you have isssues you may need to remove all tables from the database before running the SQL query.

You can also back up your databasse using this tool. Either download a copy to you local machine or set up an automatic scheduled backup to save a copy (or copies) on your server. It creates a cron job for scheduled backups.

If you upload a db for a php site don't forget to alter any database config file for your site to use the proper db credentials or make sure your set the dbname, password and user to match what your site is looking for.

  1. I have been using SFTP to upload website files/folders as a lot of people are recommending not using FTP due to security concerns. Just remember to use the proper port. I believe it is ProFTPD server under Webmin on my setup.
Topic locked