affiliate_link
Showing posts with label VPS. Show all posts
Showing posts with label VPS. Show all posts

How to install Yum on VPS


Here's a quick how to in installing yum to your VPS. I don't know about you but Virtuozzo or the Parallels team told us that it should be included in the VPS template. I am running Virtuozzo version 4 and for some reason, yum isn't installed. You should be able to install it with a flick by trying out my solution:

Linux distro: Centos 4.4

1. Login to your box thru ssh using any of your favorite ssh clients. I used mRemote.

2. Create the directory yum under /usr/src. (Optional)

3. Download the following files using the wget tool:

a. python-urlgrabber-2.9.6-2.noarch.rpm
b. python-sqlite-1.1.6-1.i386.rpm
c. python-elementtree-1.2.6-4.i386.rpm
d. python-urlgrabber-2.9.6-2.noarch.rpm
e. sqlite-3.2.2-1.i386.rpm

Usage: wget
Sample: wget http://mirror.centos.org/centos-4/4/os/i386/CentOS/RPMS/python-2.3.4-14.7.el4.i386.rpm

4. Run this command:

# rpm -Uvh *rpm

5. Download yum:

a. centos-yumconf-4-4.3.noarch.rpm
b. yum-2.4.0-1.centos4.noarch.rpm
c. yum-metadata-parser-1.0-8.el4.centos.i386.rpm

6. Proceed with item no.4.

You should be able to see a successful installation afterwards.

For an updated version of the yum dependencies and yum itself, visit Centos' repository. And speaking of dependencies, other's might encounter a dependency issue when installing components manually. Do drop by and post a quick comment and we'll try to sort things out.

Have a nice yum day!


So you're looking for a way on how to set the time on your VE or container? But I suppose that you already know that VE's clock is synchronized with the time settings of the Hardware Node? If not, read this knowledgebase entry from Parallels.


On the hardware node, you have all the right to change the time zone settings or sync the clock with an NTP server (Network Time Protocol). From the command prompt, run:


net time /setsntp:pool.ntp.org

You can use whatever NTP server you like. For my example, I used the pool.ntp.org server.


All changes made on the hardware node is automatically reflected on the Containers or VEs.
For the Virtuozzo for Linux servers, check out this post.


After days and hours of trying to make the PHP autoinstaller work on a windows 2003 VPS, I finally gave up. I've been playing around with these for a couple of days but to no avail, it doesn't work. It doesn't recognize php pages and just throws a 500 internal server error. I thought things would be easier if I use that program. Currently, I am using a Windows 2003 virtual private server (virtuozzo) with IIS 6 installed. I haven't got any single problem with the Mysql installer. Anyway, here's how I've managed to make php a part of my web server. :)

INSTALLING PHP 5.2.6 on IIS 6

1. Download the Windows binary zip file from the PHP's download site. I have downloaded the latest release which is PHP 5.2.6.

2. Create a folder named PHP on your drive C:. (C:\PHP)

3. Unzip and move all contents of the downloaded file ( of course we are talking about the PHP files) to the directory C:\PHP.

4. Rename php.ini-recommended to php.ini and then place a copy of it to the C:\Windows folder.

5. Open IIS Manager and then navigate to the website you want to use PHP with, right click and then choose Properties. You should be able to see the Home Directory tab, click Configuration.

6. Under the Application Configuration, Mappings tab, add .php extension to the application extensions. Click Add, and then browse to the PHP directory, in our case (C:\PHP) select php5isapi.dll. Type the ".php" under the Extension directive without the quotes. Set all other options to its default.

7. Also do not forget to set the "Scripts only" permission on the application settings. Just navigate the Home Directory tab to do this.

8. Go back to the IIS Manager, find the Web Service Extensions.

9. Click "Add new web service extensions..." type PHP for the extension name, choose add and then browse to the php5isapi.dll. (C:PHP\php5isapi.dll) Tick the "Set extension status to Allowed" and then click ok.

10. Finally, reboot the server.

To test if php pages are now being served by your server, create a sample php file. Include the following lines to the document:
phpinfo();
?>

Name it info.php. This file also lets you see the existing configuration for your PHP installation. Do not also forget to set the following in your php.ini:

a. Loadable Extension (Modules) Path

extension_dir = "C:\PHP\ext"

b. Session Save Path

session.save_path = "C:\Documents and Settings\Administrator\Local Settings\Temp"

If you will be using the program with mysql, simply uncomment the php_mysql.dll from the Dynamic Extensions portion of the INI file (php.ini).

Hmm so far so good. I guess that would be all. Hope this post helps. Do drop a shoutout if you think I missed out something.

^_^

After several hours of googling, and unfortunately, I'm unable to find out how to set the correct date and time on a Linux VE.

Good new is, I've tested out something that came from my mind and hey, it worked!

Here's what I did.

1. Login to the hardware node using your favorite ssh client. I used putty. It's on my downloads category.

2. I use the date command to check for the current time and date. I also used the command date to adjust the time and clock settings.

e.g. date 061913062008

That means that I want to set the date to June 19, 2008 and the current time is 13:06 or 1:00PM gmt +8.

Not that hard eh? Time to check the VE's if the changes we did to the hardware node had an effect to them. You can use the date command again in checking.

Hope this post help's you save time too.

100% CPU usage on VPS


Although my VPS is up, it continues to run very slowly. I checked on the resources being used by the VPS thru VZPP,https://ip_address:4643/ and I found out that under Resources, the CPU usage was at 100% and in red zone. The System Usage and Disk Usage are healthy, though.

When I checked on the System processess, the number of processess running is at 357. Suspecting that there may be a system limit that exceeded in the QoS settings, I went to VZMC (Virtuozzo Management Console) and under the Primary Memory related parameters, I noticed that the avnumproc is set to 40.

avnumproc is the average number of processes that will be run inside VPS.

The solution here is to increase the value set in the avnumproc (I've set mine to Unlimited).
Also, set a higher value on your numproc. This also has something to do as to how many processes the system can use.

How to turn off PHP safe mode

All you have to do is to modify your php.ini. ( Config file for PHP)

Change the line safe_mode = on to safe_mode = off.

In windows for Plesk, the path is C:\\windows\php.ini.
In linux for Plesk, the path is /etc/php.ini.

You should restart the web server service in order for the changes to take effect.

Edit:

On the Plesk 8.x versions, it provides an added functionality wherein you can edit the PHP Safe Mode option for single or multiple domains.

1. Login as administrator to the Plesk control panel.

2. Click on the Domains.

3. Check the domain you want to edit then choose Group Operations. This is located on the upper part of the Domains' page. This is also where you edit the other global changes for the domain/s.

4. Scroll down until you see the Hosting options.



5. Look for the line "PHP 'safe_mode' on", tick the radio button under the Disable column.

You can now safely assure that all of your applications that requires PHP Safe mode off will perfectly work.

*wink

Edit:

I've created a new post on how this can be done on Cpanel. Here's the link.

From SWSOFT's Knowledgebase, here's a step by step information in enabling firewall in a Virtuozzo for Linux VE. (Virtual Environment)

First of all you should define which iptables modules are available for VEs.

Edit /etc/sysconfig/iptables-config and /etc/sysconfig/vz on the hardware node. Add modules you need into IPTABLES_MODULES= and IPTABLES= lines correspondingly. Please note that all iptables modules in /etc/sysconfig/vz file in IPTABLES parameter should be listed in one single line, no linebreaks are allowed in this parameter.

For example, typical firewall configuration requires the following modules:

ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp

The changes will be applied after you load all required modules and restart Virtuozzo service (all VEs will be restarted):

# service vz stop
# service iptables restart
# service vz start


Modules you defined will be available for all VEs. However, you can also define a list of iptables modules for each VE using --iptables option of vzctl utility, e.g.:

# vzctl set 101 --iptables ipt_REJECT --iptables ipt_tos --iptables ipt_TOS --iptables ipt_LOG --iptables ip_conntrack --iptables ipt_limit --iptables ipt_multiport --iptables iptable_filter --iptables iptable_mangle --iptables ipt_TCPMSS --iptables ipt_tcpmss --iptables ipt_ttl --iptables ipt_length --iptables ipt_state --iptables iptable_nat --iptables ip_nat_ftp --save


You will probably need to increase the barrier of numiptent parameter in /proc/user_beancounters using vzctl utility. This parameter limits amount of iptables rules which VE owner is allowed to create. For example, this is how you allow to enter 400 iptables rules on VE 101:

# vzctl set 101 --numiptent 400 --save

Problem:

Cannot access or ping a Virtuozzo VPS. Status in the Virtual Management console shows that the VPS is up and running.

Solution:

After minutes of figuring out why the VE stopped responding, we finally pointed out the culprit. For some reason, the Windows Firewall Service is started automatically! One rule for a Windows VPS is that the firewall should not be running. I know it sounds too risky for the servers not to have a firewall started. But we gotta follow the "VE rules".

Here's how we did it:

Since we cannot access the virtual machine, we used the VZMC to do the needed changes.

1. Login to VZMC.

2. Look for the VPS options. ( Virtual Private Server)

3. Right click the problematic server then hit Manage Virtual Server.

4. Scroll down until you see the Services option.

5. Look for the Windows Firewall service then disable it.

That's it. You know have a working VE again.