Random Linux

Linux, video games and web hosting

To install ProFTPd on Ubuntu, you will simply need to run these commands. You can run them all as is if you are logged in as root, but will need to add sudo to the beginning of each command if you are a regular user.

apt-get update
apt-get proftpd

Then just type y at the questions that come up. When it asks you if you would like to run it from inetd or standalone, it is your choice depending on your needs, but I choose standalone.

Once that is finished, you can then edit the ProFTPd configuration file. You can find that at /etc/proftpd.conf. You should not need to change anything in this file for it to work, but feel free to take a look at it to see if there is anything you want to change.

Once you are done with that, you can check to make sure that it is running by typing this.

service proftpd status

If it says that it is running, you are ready to connect! If it says that it is stopped, you can start it by running:

service proftpd start

You can then connect using any FTP client by using the ip address as the host, 21 as the port, your username for when you log into the server and it’s password. Keep in mind that by default, each user will be jailed to their own home folder. You also cannot connect to FTP as root, only SFTP.

March 27th, 2011

Posted In: How To

Tags:

Leave a Comment

The $PATH variable in Linux is a set of directories that it will look in for executable files when you run a command. To see what is currently in your path, you can run the following command:

[email protected] [~]#echo $PATH

Which should give some output like this:

/usr/local/bin:/bin:/usr/bin:/home/username/bin

If there was a directory that you wanted to be able to run commands out of without using the full path to the directories, you want to add them to your $PATH. To do that, you will want to edit the .bash_profile, which will be found in /home/user if you need to add it for a user that you created or /root if you are wanting to add it to the path for root. So open that file with your favorite text edit editor and add something like this. In this example, we will be adding the path /home/bin.

[email protected][~]#nano /root/.bash_profile

Then under the section that says “User specific environment and startup programs”, you would add the following:

export PATH=$PATH:/root/bin

Then save the file. Now you can make sure that it was added correctly by using echo $PATH again.

[email protected] [~]#echo $PATH

Which should output the same thing but with the newly added path as well.

/usr/local/bin:/bin:/usr/bin:/home/username/bin:/root/bin

Once you do that, you are able to run any executable files that are in that folder without using the full path. For example, if you have test.sh at /root/bin/test.sh, you can just type in test.sh anywhere in the file system and it will run, you will no longer need to type in /root/bin/test.sh.

March 13th, 2011

Posted In: How To

Tags: ,

3 Comments

To extract a tar file named file.tar, you can use the following command.

[email protected] [~]#tar -xvf file.tar

In that, the x is the part that extracts, f defines the file and v gives verbose output, telling you what is being extracted.

To extract a file that is named file.tar.gz, you will use the z flag to ungzip it as well.

[email protected] [~]#tar -xzvf file.tar.gz

March 7th, 2011

Posted In: General

Tags:

2 Comments

If you need to install FFMPEG, the easiest way to do it is with yum. You can run this command to install it.

[email protected][/]#yum install ffmpeg ffmpeg-devel

If you run that command and you get package not found, you just need to add the repository for the dag packages to yum. To do that, you will want to create the file /etc/yum.repos.d/dag.repo

[email protected][/]#nano /etc/yum.repos.d/dag.repo

then add this in it

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

Then save the file.

After that, go ahead and add the key for the repository so you don’t receive any key errors.

[email protected][/]#rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Once you do that, you should be able to install those packages with yum without a problem.

February 28th, 2011

Posted In: How To

Tags:

2 Comments

When you are installing subversion using yum on a server that has cPanel on it, you will receive an error about missing dependencies for perl(URI), which will look something like this:

[email protected] [~]# yum install subversion
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirror.team-cymru.org
* base: dist1.800hosting.com
* extras: mirror.5ninesolutions.com
* updates: mirror.team-cymru.org
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package subversion.i386 0:1.4.2-4.el5_3.1 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Processing Dependency: neon >= 0.25.5-6.el5 for package: subversion
–> Processing Dependency: libneon.so.25 for package: subversion
–> Processing Dependency: libapr-1.so.0 for package: subversion
–> Processing Dependency: libaprutil-1.so.0 for package: subversion
–> Running transaction check
—> Package apr.i386 0:1.2.7-11.el5_3.1 set to be updated
—> Package apr-util.i386 0:1.2.7-7.el5_3.2 set to be updated
—> Package neon.i386 0:0.25.5-10.el5_4.1 set to be updated
—> Package subversion.i386 0:1.4.2-4.el5_3.1 set to be updated
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Finished Dependency Resolution
subversion-1.4.2-4.el5_3.1.i386 from base has depsolving problems
–> Missing Dependency: perl(URI) >= 1.17 is needed by package
subversion-1.4.2-4.el5_3.1.i386 (base)
Error: Missing Dependency: perl(URI) >= 1.17 is needed by package
subversion-1.4.2-4.el5_3.1.i386 (base)
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest

To work around this issue, you can edit your /etc/yum.conf file to remove the part that tells the package that it needs those dependencies. So first you will want to back up the current configuration to make sure that you can go back to the original when you are done.

[email protected] [/]# cp /etc/yum.conf /etc/yum.conf-bak

Then the file will look like this.

[email protected] [/]# nano /etc/yum.conf

[main]
exclude=apache* bind-chroot courier* dovecot* exim* httpd* mod_ssl* mysql* nsd* perl* php* proftpd* pure-ftpd* ruby* spamassassin* squirrelmail*
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1

# Note: yum-RHN-plugin doesn’t honor this.
metadata_expire=1h

# Default.
# installonly_limit = 3

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

On the second line, you will want to delete perl*, then save the file and exit out. Once you do that, you will be able to install the subversion package using yum as normal. Once the package is installed successfully, just rename the original file back to yum.conf and overwrite the edited one, and it is installed!

February 28th, 2011

Posted In: How To

Tags:

Leave a Comment

There are some scripts that you install that will require some extra PHP elements to be able to run. When installing PHPMotion, I came across this error.

Warning: dl() [function.dl]: Temporary module name should contain only filename in /home/user/public_html/site.com/classes/config.php on line 2
PHP script /home/user/public_html/site.com/classes/config.php is protected by phpSHIELD and requires the phpSHIELD loader phpshield.5.2.lin. The phpSHIELD loader has not been installed, or is not installed correctly. Please visit the phpSHIELD php encoder site to download required loader.

That is saying that you need to install the phpSHIELD loader. So, the first thing that you will need to do is to download the loader. I was able to get that from http://www.phpshield.com/loaders/ixed4.lin.x86-64.zip for CentOS 5.5 64 bit. You can also find the rest of the loaders at http://www.phpshield.com/loaders if you need it for a different operating system.

Then, we will need to check what the path is to the folder that holds the modules for PHP, which you can find in the php.ini. On the version of CentOS that I am using, that is found at /usr/local/lib/php.ini. You will want to find the part that says
; Directory in which the loadable extensions (modules) reside.
extension_dir = “/usr/local/lib/php/extensions/no-debug-non-zts-20060613”

You can also just use grep as a shortcut to find this so you dont have to look in the php.ini or create a phpinfo page. This will do that for you.

[email protected] [~]# grep extension_dir /usr/local/lib/php.ini
extension_dir = “/usr/local/lib/php/extensions/no-debug-non-zts-20060613″
; extension_dir directive above.

After that, you will want to check the version of PHP that you are using so you can choose the correct module to move to the modules folder that goes with your version of PHP. In our case, it is 5.2.9.

[email protected] [/]# php -v
PHP 5.2.9 (cli) (built: Feb 22 2011 10:26:40)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Then you can create a folder, move the zip file with the modules into that folder, and decompress it. it will give you a few files, but you are going to only need one of those.
[email protected] [~]# unzip ixed4.lin.x86-64.zip
Archive: ixed4.lin.x86-64.zip
inflating: ixed.4.3.lin
inflating: ixed.4.3ts.lin
inflating: ixed.4.4.lin
inflating: ixed.4.4ts.lin
inflating: ixed.5.0.0.lin
inflating: ixed.5.0.0ts.lin
inflating: ixed.5.0.1.lin
inflating: ixed.5.0.1ts.lin
inflating: ixed.5.0.2.lin
inflating: ixed.5.0.2ts.lin
inflating: ixed.5.0.lin
inflating: ixed.5.0ts.lin
inflating: ixed.5.1.lin
inflating: ixed.5.1ts.lin
inflating: ixed.5.2.lin
inflating: ixed.5.2ts.lin
inflating: ixed.5.3.lin
inflating: ixed.5.3ts.lin

[email protected]# [~]#ls
./ ixed.4.3ts.lin ixed4.lin.x86-64.zip ixed.5.0.1.lin ixed.5.0.2ts.lin ixed.5.1.lin ixed.5.2ts.lin
../ ixed.4.4.lin ixed.5.0.0.lin ixed.5.0.1ts.lin ixed.5.0.lin ixed.5.1ts.lin ixed.5.3.lin
ixed.4.3.lin ixed.4.4ts.lin ixed.5.0.0ts.lin ixed.5.0.2.lin ixed.5.0ts.lin ixed.5.2.lin ixed.5.3ts.lin

Then for the 2.9 version of PHP that we have, we only will need the ixed.5.2.lin file. When we checked for our extensions directory, it came out to be /usr/local/lib/php/extensions/no-debug-non-zts-20060613, so that is where we need to move that file.

[email protected]# [~]#mv ixed.5.2.lin /usr/local/lib/php/extensions/no-debug-non-zts-20060613

Then, all you have left to do is to add a line to your php.ini file and you are done. You will want to use a text editor to add extension=”ixed.5.2.lin” to the line below where it specifies the extension directory. So, it should go from looking like this:

; Directory in which the loadable extensions (modules) reside.
extension_dir = “/usr/local/lib/php/extensions/no-debug-non-zts-20060613”

to

; Directory in which the loadable extensions (modules) reside.
extension_dir = “/usr/local/lib/php/extensions/no-debug-non-zts-20060613″
extension=”ixed.5.2.lin”

Then, just save the php.ini with your change and it is done! If that is the only error that you had with the site, it should be up and working now!

February 26th, 2011

Posted In: How To

Tags:

Leave a Comment

To find which version you are using in CentOS, you can check the redhat-release file in /etc. When you check that file, you will see something like this:

[email protected] [~]# cat /etc/redhat-release
CentOS release 5.5 (Final)

February 25th, 2011

Posted In: How To

Tags:

Leave a Comment

You can check the kernel information as well as a few other things using the uname command. Using just uname alone will usually just show you that you are using the Linux kernel.

[[email protected] ~]# uname
Linux

To see just the kernel release, you can use the -r flag.

[[email protected] ~]# uname -r
2.6.18-194.26.1.el5.028stab079.2

Then the -v to see the version of the kernel that you are using.

[[email protected] ~]# uname -v
#1 SMP Fri Dec 17 19:25:15 MSK 2010

To check the processor type, you use the -p flag

[[email protected] ~]# uname -p
x86_64

Then, you can check the operating system with the -o flag.

[[email protected] ~]# uname -o
GNU/Linux

Along with the hostname command, you can use uname to see your hostname.

[[email protected] ~]# uname -n
server

Finally, if you want to see all of this information at the same time, you can use the -a flag for all, which is the one that i use anytime i need to see this information.

[[email protected] ~]# uname -a
Linux server 2.6.18-194.26.1.el5.028stab079.2 #1 SMP Fri Dec 17 19:25:15 MSK 2010 x86_64 x86_64 x86_64 GNU/Linux

February 21st, 2011

Posted In: General

Tags:

Leave a Comment

There are times when you try to update cPanel from the UI and it will fail or will hang.  When this happens, you are able to force the update from the comamnd line.   SSH into the server as root, then run the following command.

/scripts/upcp --force

This will show you what is going on will normally fix any update issues that you were having, but will also help you to troubleshoot any problem that may come up with the update.

January 21st, 2011

Posted In: cPanel Hosting, How To

Tags: ,

Leave a Comment

If you have ever used cPanel, there may have been a time that a DNS zone was missing even though your domain was already added on.  If you have root access, you are able to fix this by using the adddns script.  This is located in the /scripts directory, but only if you are using cPanel.  So to use this,  you will define the domain and the IP that it is for.

/scripts/adddns --domain=site.com --ip=123.456.7.89

That will create a dns zone for the domain site.com with the address on the server of 123.456.7.89.  You can then check /var/named/site.com.db to make sure that it created successfully.

January 18th, 2011

Posted In: cPanel Hosting, How To

Tags: ,

Leave a Comment

Next Page »