![]() |
How to manage a vps
As you can guess from the title, I'm thinking of taking an unmanaged VPS (eg. digitalocean), I have already tried in the past, with CentOS 6 and CWP (CentOS Web panel), I have not had very different results from a hosting, and then after a few months I closed it.
Now many of your tips to my posts lead me to a VPS, so I'm thinking of trying it again. But I would like to start well, possibly avoiding as many errors as possible. I need some advice, for example: Use a software like cpanel or CWP (or other free) or do everything from command line? Or what else? Using Apache or Litespeed? Use tool like varnish reverse proxy? What to do absolutely? What to avoid absolutely? What is needed to not consume too much resources? etc, etc, etc... I think I can do it all by myself (with the right guides), but please help me to take at least the correct initial direction. |
I can strong recommend serverpilot i use with vultr, digitalocean and linode - paid and free option - I never get any problems. for me is a best option to manage vps.
|
If you didn't saw a difference, there are many things to consider before making assumptions, like how the software was written.
If you have background processes, like a newsletter or video encoder, you should see a difference (even with your current setup though). 1. Open to the public only what you have to. Use the command line as it will use less resources. A reason to use CPanel is if there are other managers, or it is more productive. 2. Litespeed looks promising, but I never use it so I can't advise. 3. Yes, for caching. Also read on these topics: 1. Security, specifically on SSH access and firewall. 2. Databases (access control, backups). 3. Caching (HTTP caching if you are hosting the media and not using a CDN). 4. Timezones Lnode and Digital Ocean have some good tutorials. There are YouTube videos as well: https://www.youtube.com/watch?v=oFduaKmAEbg |
Not sure what you mean by "I have not had very different results from a hosting". What difference did you expect?
Hosting your money sites on unmanaged server and trying to manage it "with the right guides" isn't a good idea. Looks like you need a fully managed solution or hire someone who knows what they are doing. |
seems like you are CLUELESS and have no idea how to properly manage a server so why not get a fully managed VPS? It costs a bit more but you can sleep better... or are you really that BROKE and can't afford to pay a few bucks more for a fully managed plan? :1orglaugh:1orglaugh
|
Quote:
|
Quote:
|
Wow thanks for the replies, I didn't expect so many. I try to answer everyone in one post.
I gave a look at serverpilot, but I do not understand what it does... I can't find screenshots, guides, anything... Basically serverpilot installs in your place a server in digitalocean with serverpilot panel? It is not like Cpanel? Preferably wordpress, and to you remains only to monitor the server? In this case, I need more autonomy. My sites for work requiring substantially only php, mysql and cronjob. Quote:
This time is different, I want to move to digitalocean my vps Quote:
Lately this problem "Mysql-open-file-limit-100000" https://gfy.com/webmaster-q-and-fucki...-100000-a.html. The last one I purchased on hawkhost every so often decides to do something that consumes all the cpu (normal operation of my sites consumes about 10% of the cpu) and restrict all of my sites and no one can explain why. This creates a lot of problems to google When for an period, my vps worked properly, my sites also arrived at the 20000, 30000, or 50000 visits a day, now 2000-3000, and when they start to increase something breaks... and I'm pretty sure that is not a problem of my sites consumption of resources because in the last few years I have changed 4-5 vps from different providers and it is always some different bullshit that creates problems. Quote:
I can install apache, php and mysql etc, the one that I don't know is for example if it is worthwhile to install varnish or not from the point of view of the server. In the sense that it definitely brings benefits to the sites, but maybe, varnish use a lot of resources or consumes too much cpu... I really need this type of advice to set up a server. I am afraid of some problems or particular errors that the server may have (ex: "Mysql-open-file-limit 100000"), but also with the managed vps they have never come to a solution. I always open a ticket in support and: The first responses to the ticket are always: buy more resources and give me more money. The next are: will it be a problem of the code please contact your developer (me). Then usually respond with some bullshit to take time. Then comes an idiot who doesn't want to read all of the ticke and still responds to: buy new services, please contact the developer. And usually at this point I send them to hell. The assistance is only for simple things, for particular problems do not have the desire or ability to find a solution. Or at least, I never found one that was able to solve serious problems. The only real solution is always to change vps, and hope that in the new vps, everything is working. Often I even found myself the solution, but I have not been able to apply because I did not have the necessary access or permissions of the server, and also suggesting to support have done nothing. Of this, what do you think CentOS Web Panel | Free Linux Web Hosting Control Panel Always thinking from the server side. To me it looks not bad, I used it in my tests and in general I have not had any major problems. But maybe it consumes too many resources, or some gap? Es. suPHP, is it good or not? I don't know ... There is also a support, forum, tickets, etc., even if this tends to send often to the paid service. However, you can pay only when you need it. Sorry if I have dwelt. Thanks for the replies. |
I use serverpilot and I am very happy with that ! Plus I have some basic linux knowledges!
|
Buy a $5 mo instance in the Cloud VPS
Make a subdomain named dev.yourdomain.tld point the 'A' in your current server's dns for that subdomain to the new server IP. set the new server's dns to that subdomain and its 'A' IP I would install Ubuntu 16.04 LTS others will argue their favorite os CentOS is another commonly used. open a SSH session and change to root user get to work Digitalocean and Linode have tutorials search out what you need to do. unix.stackexchange.com is a good source. Google is your friend -- use it. when dev.yourdomain.tld seems to be working to your satisfaction -- from that location -- I am assuming /path/yourdomain.tld/dev; cd to [......]/dev $ cp -R * ../ copy recursively the site files up a level to the main (parent) domain's directory create a new server configuration for the parent domain on the new server change your DNS 'A' for the parent domain on the old server add the parent domain to the DNS new VPS server with the new server's 'A'. Migration of the HTTP part and the MySQL is now complete? Or, pay for a managed VPS server and and do the things that you are good at now. Using a control panel on a VPS or dedicated server is like using a leaky condom IMHO -- You can't feel a thing and it leaks all over the place :laughing- |
See my sig. They provide full management at a cheap monthly price (transfer to the new location included).
|
So, these days I'm thinking about Digitalocean, maybe with panel, maybe not.
I would be interested in a panel especially to be able to monitor my sites. Exist anything that allows you to do everything from command line but with statistics and graphs for monitoring? |
https://s17.postimg.org/5uupd7igr/dig0cean-monitor.jpg
open thumbnail link for larger image DigitalOcean has a monitoring GUI you can set up. There are probably web interfaces for LINUX console monitoring. |
for vps monitoring I recommend https://nixstats.com
|
If you do not know how to manage a server then I would not recommend getting an unmanaged VPS.
If you want to learn how to manage a server then I would recommend installing a virtual machine and learning the ropes locally on your computer instead of learning on a live product. Having an un managed VPS is a decent solution however it can be much cheaper and easier to scale an AWS EC2 Cloud Instance, which is very similar to having an un-managed vps but you have a lot more control and options. |
Better yet, install LINUX on an old computer and start learning.
I would recommend Ubuntu as there is a large Internet knowledge base to learn from -- Debian commands work too. If you decide later to use another LINUX operating system on a host server adapting most of the commands will be easy. You can open a terminal and practice -- SSH is just a remote terminal program. |
I prefer to handover VPS Management company.To answer your question light speed would be better option but before that you need to check with mail platform and plugins used in it .
|
Stupid question... better CentOS or Ubuntu server?
|
Take Ubuntu, it will make everything easier for you (although CentOS isn't a bad choice)
|
But what is best for performance, speed, etc?
If it is difficult, I learn, I have already used CentOS even without too many problems |
So stay with what you know, it doesn't matter for your use, and these are solid OS.
What is your stack right now? |
I agree -- it's a matter of the devil you know best.
|
Ok, I want to try ubuntu with sentora (ex zpanel), just to begin with, then in case we change
|
Aaaaand now that I created the droplet and I would be ready to install I have doubts about the panels...
I made a small list of what I use of cpanel and for what Actually, of cpanel the only buttons I use are:
Everything else I've practically never even looked at. On this server I think to put only 4-5 sites, very simple, need only PHP, MySQL, and cronjob to work Then some caches, eg. Memcache, varnish, Opcache, acpu, etc. I could use this https://www.digitalocean.com/communi...n-ubuntu-16-04 to put the server online This https://nixstats.com to monitor it PHP I think I use the 5.6, the subsequent I have always caused problems or loss of visits (but maybe it's my problem) I need a quick way to turn on/off errors and set E_ALL &-E_NOTICE, but I think it's always php.ini (Don't go very well with my URL rewriters, they create endless log files and they waste a lot of resources, so I turn it on and off every time I have to make some changes) For varnish and other chache I hope there are guides around... Mails don't need it I miss HTTPS, some sites use it, I have used let's encrypt, but I think he needs a panel, I also saw Autossl, but I did not use it, I have no idea how it works, suggestions? Surely, it seems little but it is very much, there will be many small things to configure install and manage, but I have taken a look at some guides and overall it does not seem impossible At this point I think I still keep a bit the shared server and start moving just a couple of sites (the one with a few visits) in the new droplet Digitalocean and start to make everything work, then if everything works keep moving sites, otherwise I change the DNS and I return to the shared server... (Hopefully not) Tips? Recommendations? Things I forgot? Problems that I will surely meet? Errors that everyone does at the beginning, to avoid? Every help and advice is greatly appreciated... thanks |
MySQL
Code:
barry@paragon-DS-7:~$ mysql -u[username] -p Find your packages sudo apt search 'what you need' Code:
barry@paragon-DS-7:~$ sudo apt search php |grep -i 'php' https://github.com/rosehosting/nginx...nginx_vhost.sh Nginx HTTP server script https://www.google.com/search?num=10...+host+scr ipt Google is your friend Let's encrypt https://certbot.eff.org/docs/ good luck |
Quote:
I have used both CentOS is very similar to Red Hat Enterprise and Ubuntu is based off of Debian. I enjoy working with Ubuntu a bit more than working with CentOS. In the end it comes down to personal preference. One of the main reasons I enjoy ubuntu better is because out of the box it comes with APT (Advanced Packaging Tool) library to perform installation and manage software. Where CentOS uses YUM. Both APT and YUM are great and pretty much do the same thing, but this is where it comes down to preference. I would rather type something like this to install mysql Code:
sudo apt-get install mysql-server Code:
sudo yum install mysql-server Its also worth noting that you can install APT on CentOS. :2 cents: |
Quote:
You can install Apache, PHP, and MYSQL using tasksel... Code:
sudo apt-get install tasksel To install phpmyadmin use Code:
sudo apt-get install phpmyadmin |
Thanks guys
I did the first step with Apache virtual host, now expect DNS propagation to see if everything works. (Hopefully well) Thanks for the support |
Shit, something's not working.
I did not do much... installed virtual host, created 2 files and changed the DNS First this guide https://www.digitalocean.com/communi...n-ubuntu-16-04, an installation and a couple of files Then this Https://www.digitalocean.com/communi...h-digitalocean http://porn-update.com/temp/Schermat...2000:01:16.png I changed the DNS on Namesilo and waited for it to propagate... Domains alternativegirlshardpics.com and transgender-hardpics.com It's been 24 hours and nothing seems to work. The 2 sites seem crazy, I expect to see those 2 stupid files "Welcome to Test.com!" instead sometimes "impossible to reach the site", ther times I see the old site, sometimes I see it without CSS... I can not understand if it is my PC, my browser, my connection or if there is really some error... How do you see my 2 sites? Did I get something wrong? |
is that the right IP?
Code:
barry@paragon-DS-7:~$ dig any transgender-hardpics.com if the IP is right the apache web server is misconfigured or if you have a firewall HTTP 80 and HTTPS 443 is not open try server@root$ service ufw status try server@root$ service apache2 status |
Code:
root@ubuntu-2gb-blr1-01:~# service ufw status It makes you install a virtual host including the sample pages and does not let you open the firewall, as first step has a really demoral effect... First or later you think maybe it's better if I stop doing the programmer and I'm going to sell ice cream in Germany Looking for the errors reported by the commands that indicated me Barry-Xlovecam, I ended up on this https://www.digitalocean.com/communi...n-ubuntu-16-04 guide, which would be the next one I would have done, maybe it was better to do this first. I have configured the firewall and now it works Thank you very much for the help Now LAMP.... surely I'll be back for the next issue, probably caused by a guide stupid :) |
OK, I installed MySQL and PHP without too many problems
I have not seen things like: Which version of PHP I installed (I would like 5.6), PFM or mariadb, etc... However, I came to the installation of the modules In the current VPS I have these http://porn-update.com/temp/Schermat...2002:47:29.png The new server me from a list of installable http://porn-update.com/temp/php_modules.txt But something is missing, for example PDO... probably going to be installed separately My sites need just, php, mysql-pdo, cronjob, and some cache, no mail. But there are other modules that are extremely necessary to install that I don't know? |
open a ssh session
Code:
$ php -i|less Code:
$ php -i|more Quote:
I am using php 7.0 now you need to find these for your older version this is a good working start up install I found. Code:
$ sudo apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext |
Hi, in the list of this command php -i|less, PDO there, but does it mean it is already installed or that I can install it?
Code:
phpinfo() I have absolutely no idea why this thing happened... :Oh crap Can a downgrade of PHP create problems? Even if the server is new/empty Code:
sudo apt search php| egrep -i 'PDO|curl' |
Quote:
|
Quote:
In practice there may be parts of your site that don't work well with one of the two versions, depending on for what version they were written. The differences between PHP5 and PHP7 may be the reason why you've experienced drop in traffic earlier. Something probably didn't work as it's supposed to but it went unnoticed. If you can confirm that your code works on both versions PHP7 is faster so I'd stick with it. |
Code:
$ sudo apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext php7.0-mysql was the fix, the rest looked useful to me so I installed them: gd, pear, imagemagic and sqlite3. I have needed to use these in the past and they were not installed. My HTTP server is Nginx and PHP will work out of the box with a tweak to the gateway For reference: Fix Nginx PHP gateway -- if anyone else is struggling with this ... Code:
location ~ \.php { Code:
root@localhost:/etc/php/7.0/fpm/pool.d# egrep 'listen' www.conf |
My sites works with 7, the code structure of my sites is very simple, I have basically just updated all queries from mysql to pdo
|
So I did a few things... I did the PHP downgrade with this:
Code:
From php5.6 to php7.0: But it does not work almost anything...:feels-hot PHP does not seem to work, I put 2 files in the root, index.php and Info.php (phpinfo), return 2 pages blank... looking at the source code you see the PHP code... By visiting https:alternativegirlshardpics.com, it says invalid certificate Shit, it happened some mess... you think I can fix it? Even when I install modules I'm not sure about installing them on PHP 5.6 or 7 I almost thought about making a new droplet and install directly only PHP 5.6 Then I noticed that the folder structure is domain1.com/public_html Domain2.com/public_html I would like to public_html/domain1. com public_html/domain2. com Just change the addresses of the files on VirtualHost? |
If the PHP 7 was working why mess with it?
It was working in HTTP or in cli only (terminal) As far as your paths; You need to add 80,443 and what is needed for TLS (SSL HTTPS) Code:
<VirtualHost *> |
But where?
I have this: sudo nano /etc/apache2/sites-available/alternativegirlshardpics.com.conf and this: sudo nano /etc/apache2/mods-enabled/dir.conf |
And then suddenly a lighting...
is there anything in the PHP configuration that does not work <? But it requires this <?php, probably not active |
Quote:
$cd /etc/apache2/sites-available $ls -1 [see what is there] $cp alternativegirlshardpics.com.conf alternativegirlshardpics.com.conf~ [back up your file that works] nano /etc/apache2/sites-available/alternativegirlshardpics.com.conf [make your edits] ^X 'y' $a2ensite alternativegirlshardpics.com.conf $ /etc/init.d/apache2 restart or; service apache2 restart php is always starts 5 and 7 (4 was <? as I recall) <?php '{......}' ?> in php 7 you actually don't need the closing tag -- try it LOL works ... check your return on this Code:
barry@paragon-DS-7:~$ apt search apache2|grep 'php' |
Thank you
Almost online, in the end I thought I'd install an 14.04 with PHP5 native, then later with calm install a 16.04 with PHP 7. And I will manage the whole changing DNS There are almost, the databases are online, the files are online, only one last thing is missing, the symlink. My sites to work need to symlink to a folder that contains functions shared by all. Usually on VPS with cpanel I created the symlink by creating a file with this code and loading it into public_html. Code:
symlink('/home/pornupda/public_html/function_global', '/home/pornupda/public_html/transgender-hardpics.com/function_global'); I have these /var/www/html/ /var/www/public_html/ In /html responds the server IP, in public_html my sites (following the tutorial has happened this) In public_html: Alternativegirlshardpics.com Function_global Transgender-hardpics.com I tried to create the symlink with this code Code:
symlink('/var/www/public_html/function_global', '/var/www/public_html/alternativegirlshardpics.com/function_global'); But he says Code:
Warning: symlink (): Permission denied in/var/www/html/add_symlink_digitalocean.php on line 3 Can I change /html in /public_html? is a mess happening? Better rather if I move my sites from /public_html to /html? Just to put a little in order... |
Found :thumbsup
From terminal Code:
ln -s path/to/source path/destination/symlink |
I make my document root for the server permissions
username:www-data user:group the command is from the level above the directory whose permissions you want to change Code:
$ stat 'the directory name' also to FTP into the ..../html owner 0 root if html/mydocroot is username:www-data and there is a symbolic link ... I use scp at the command line or sftp in a FTP client -- then you need no FTP server, its all over ssh -- more secure and less resources used. the symbolic link may not work due to a permissions conflict? ** ln -s yeah .... |
Sites Online! :)
But nothing works... :Oh crap Only the HTTPS version works https://www.alternativegirlshardpics.com/ Without HTTPS Code:
Internal server Error Code:
< img src = "https://www.alternativegirlshardpics.com/images/blank.gif" data-src = "https://images03-fame.gammacdn.com/movies/64703/64703_01/previews/2/174/top_1_185x135/64703_01_01.jpg" https://www.alternativegirlshardpics.com/1004 It seems a problem URL rewriter, but on port 443 ??? Seems like an SSL problem. In both sites I have added a certificate let's encrypt, following this guide https://www.digitalocean.com/communi...n-ubuntu-14-04 What's missing??? I'll attach the various virtual host files because I'm not understanding anything anymore /etc/apache2/sites-enabled/000-default.conf Code:
<VirtualHost *:80> Code:
<VirtualHost *:80> /etc/apache2/sites-available/alternativegirlshardpics.com-le-ssl.conf Code:
<IfModule mod_ssl.c> Code:
[Wed Aug 02 21:11:14.880693 2017] [ssl:warn] [pid 1306] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366) |
Meanwhile I created another droplet and started it all over again, and it worked...
The 2 sites are online, it works url_rewriter and I solved the problem of the photos (my fault, uploaded an old file without a JavaScript) The only thing I haven't reinstalled is let's encrypt, so my sites now only work in http So I think it's been let's encrypt to make the mess... I would not repeat everything, so I'm thinking about another way to make HTTPS, suggestions? P.S. How do I know if Opcache, memcached and APCU, etc. are working? Last stupid question: varnish does not work in HTTPS? Should I use Nginx for HTTPS? |
Sites Online! :):):)
I destroyed and created a hundred droplet in the meantime, but we finally got to have the 2 sites online with working HTTPS https://www.alternativegirlshardpics.com/ https://www.transgender-hardpics.com/ I tried to install varnish with Apache and Nginx, but it was like throwing a firecracker inside the server case, nothing worked anymore and there was no way to understand why... The guides seem kinda old, maybe varnish is dead with https... ??? Anyway we are online, now optimization... cache, gzip compression, monitoring etc etc etc, tips? |
You are hotlinking to images that are not using TLS(HTPS)
So, your SSL is broken -- not your fault -- but is broken HTTPS better than no HTTPS? |
All times are GMT -7. The time now is 03:12 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc