yum -y install gmp-devel
wget http://freshmeat.net/redir/clamav/29355/url_tgz/clamav-0.97.3.tar.gz
adduser -M -s /bin/false clamav
tar zxf clamav-0.97.3.tar.gz
cd clamav-0.97.3
./configure --prefix=/usr/local/clamav
make install
for binaries in `find /usr/local/clamav/bin/*` ; do ln -s ${binaries} /usr/bin/; done
Read more: http://crazytoon.com/2007/10/19/linux-virus-scan-how-do-i-check-my-linux-installation-for-viruses-using-clamav-centos-linux-redhat/#ixzz1nf1gPXFp
At this point Clam AntiVirus is installed and ready for use. Edit the configuration file and remove the line which says: Example It is there to ensure. If you want, you can look at other options but we don’t need to change anything else here to make ClamAV work for us.
vi /usr/local/clamav/etc/freshclam.conf #remove Example
Now let us run the freshclam which will download virus database and bring our virus database up to date. We should do this manually and make sure it didn’t give any errors. If this works, you will a lot of “downloading” messages.
/usr/bin/freshclam
If everything checks out, let us add this to our crontab to ensure our virus database is updated hourly. I chose to be updated every 9 minutes in to every hour. You can change to fit your needs or leave it as it is.
crontab -e
9 * * * * /usr/bin/freshclam –quiet
At this point our ClamAV virus database is up to date and now we can scan whichever directory we want. Go to the directory you want to scan and type:
clamscan -r -i
Once it is done scanning, it will display something similar to below.
-r parameter tells clamscan to recurse into directories
-i will print out infected filenames
Read more: http://crazytoon.com/2007/10/19/linux-virus-scan-how-do-i-check-my-linux-installation-for-viruses-using-clamav-centos-linux-redhat/#ixzz1nf1lINvr
SSH into the Linux server.
Change the directory to the blog directory.
Backup the MySQL database by running the following command substituting in your own information (where root is the MySQL root username and [databasename] is the actual WordPress database being used for the site):
mysqldump –u root –p [databasename] > [databasename].sql
Download the latest version of Wordpress by running this command:
wget http://wordpress.org/latest.tar.gz
Unzip the download.
tar -xzvf latest.tar.gz
Make a backup of your data just in case something goes wrong or if you have custom content where blogdirectory is the directory the blog is installed):
tar -czvf blog_backup.tgz blogdirectory/
Overwrite the files, thus upgrading the blog, by running this command (where blogdirectory is the directory the blog is installed):
yes | cp -r wordpress/* blogdirectory/
Now go to your blog admin section and verify everything is correct. You may be asked when viewing the admin section to upgrade the database. Click OK to do so.
Your blog is now upgraded to the latest version.
Change the directory to the blog directory.
Backup the MySQL database by running the following command substituting in your own information (where root is the MySQL root username and [databasename] is the actual WordPress database being used for the site):
mysqldump –u root –p [databasename] > [databasename].sql
Download the latest version of Wordpress by running this command:
wget http://wordpress.org/latest.tar.gz
Unzip the download.
tar -xzvf latest.tar.gz
Make a backup of your data just in case something goes wrong or if you have custom content where blogdirectory is the directory the blog is installed):
tar -czvf blog_backup.tgz blogdirectory/
Overwrite the files, thus upgrading the blog, by running this command (where blogdirectory is the directory the blog is installed):
yes | cp -r wordpress/* blogdirectory/
Now go to your blog admin section and verify everything is correct. You may be asked when viewing the admin section to upgrade the database. Click OK to do so.
Your blog is now upgraded to the latest version.
To password protect your website, please follow these steps:
Log into your Linux web server via Secure Shell (SSH).
Change into the directory you wish to password protect.
Note: If you wish to protect your entire website us the following command:
cd /vservers/username/htdocs
Create a file called .htaccess using the following command:
pico .htaccess
Enter the following information:
AuthType Basic
AuthName "Please enter your Username and Password"
AuthUserFile /vservers/username/htdocs/.htpasswd
AuthGroupFile /dev/null
Require valid-user
Press ctrl+o to save the file.
Press ctrl+x to exit the file.
Create the .htpasswd file using the following command:
/usr/bin/htpasswd -c /vservers/username/htdocs/.htpasswd username
Enter the password you wish to use.
Re-enter the password.
Grant read access to each file using the following commands:
chmod a+r .htaccess
chmod a+r .htpasswd
Log into your Linux web server via Secure Shell (SSH).
Change into the directory you wish to password protect.
Note: If you wish to protect your entire website us the following command:
cd /vservers/username/htdocs
Create a file called .htaccess using the following command:
pico .htaccess
Enter the following information:
AuthType Basic
AuthName "Please enter your Username and Password"
AuthUserFile /vservers/username/htdocs/.htpasswd
AuthGroupFile /dev/null
Require valid-user
Press ctrl+o to save the file.
Press ctrl+x to exit the file.
Create the .htpasswd file using the following command:
/usr/bin/htpasswd -c /vservers/username/htdocs/.htpasswd username
Enter the password you wish to use.
Re-enter the password.
Grant read access to each file using the following commands:
chmod a+r .htaccess
chmod a+r .htpasswd
Create a notepad file and save it as .htaccess if you do not already have an existing one.
Update the .htaccess file with the following code and save; be sure to replace domain.com with your domain name.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
Upload the .htaccess file via ftp to the site root and now your traffic will be redirected to www.domain.com.
Update the .htaccess file with the following code and save; be sure to replace domain.com with your domain name.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
Upload the .htaccess file via ftp to the site root and now your traffic will be redirected to www.domain.com.
NFS, or Network File System, is a protocol for sharing and mounting remote file systems over a network.
Installation
To run an NFS server on Redhat or CentOS Linux, the systems package 'nfs-utils' must be installed. The 'yum' package manager can be used to ensure this is installed.
yum install nfs-utils
Configure Shares
NFS shares are created via the /etc/exports configuration file. To create a share you must specify a path to share, as well as a list of hosts to grant access and the type of access they should have. The path to share must be a full system path, and the list of hosts can be specified as a single host (IP, FQDN, or hostname), with wildcards (*.domain.com), IP networks (1.2.3.4/24), or netgroups.
For example, to share the directory '/data' with the host 10.10.1.5 (read-only) and the hosts within 10.10.1.15/29 (read-write), the following line would be added to /etc/exports.
/data 10.10.1.5(ro) 10.10.1.15/29(rw)
The list of access hosts must be separated with spaces, and no space must exist between the host address and the opening '(' of its options. If no options are specified, the host will have read only access. If options are specified without a host preceding it, they will be the share's default.
For a full list of options, please refer to the exports man page.
man exports
Starting the NFS Server
The NFS server is controlled with the service init script '/etc/init.d/nfs', or through the 'service' command. However before nfsd can run, the 'portmap' service must be running as well.
service portmap start
service nfs start
The NFS server will now be running, and shares (or 'exports') can be mounted by remote hosts that are given access. If the exports file is modified after the service is started, you can apply them with the command
exportfs -r
Also be sure to use the 'chkconfig' command to add both services to the system runlevel to run on startup.
chkconfig portmap on
chkconfig nfs on
Firewall notes
If your NFS server is behind a firewall (hardware or iptables), relative to the connecting hosts, the port "2049" must be opened for TCP and UDP.
Installation
To run an NFS server on Redhat or CentOS Linux, the systems package 'nfs-utils' must be installed. The 'yum' package manager can be used to ensure this is installed.
yum install nfs-utils
Configure Shares
NFS shares are created via the /etc/exports configuration file. To create a share you must specify a path to share, as well as a list of hosts to grant access and the type of access they should have. The path to share must be a full system path, and the list of hosts can be specified as a single host (IP, FQDN, or hostname), with wildcards (*.domain.com), IP networks (1.2.3.4/24), or netgroups.
For example, to share the directory '/data' with the host 10.10.1.5 (read-only) and the hosts within 10.10.1.15/29 (read-write), the following line would be added to /etc/exports.
/data 10.10.1.5(ro) 10.10.1.15/29(rw)
The list of access hosts must be separated with spaces, and no space must exist between the host address and the opening '(' of its options. If no options are specified, the host will have read only access. If options are specified without a host preceding it, they will be the share's default.
For a full list of options, please refer to the exports man page.
man exports
Starting the NFS Server
The NFS server is controlled with the service init script '/etc/init.d/nfs', or through the 'service' command. However before nfsd can run, the 'portmap' service must be running as well.
service portmap start
service nfs start
The NFS server will now be running, and shares (or 'exports') can be mounted by remote hosts that are given access. If the exports file is modified after the service is started, you can apply them with the command
exportfs -r
Also be sure to use the 'chkconfig' command to add both services to the system runlevel to run on startup.
chkconfig portmap on
chkconfig nfs on
Firewall notes
If your NFS server is behind a firewall (hardware or iptables), relative to the connecting hosts, the port "2049" must be opened for TCP and UDP.
Network File System shares, or NFS exports, are easily mounted to Linux servers. Before an NFS export can be mounted, the nfs-utils package must be installed.
yum install nfs-utils
Additionally, the 'portmap' service must be running and enabled.
service portmap start
chkconfig portmap on
To mount the share, you'll need the following information.
The hostname, domain name, or IP of the NFS server.
The full path of the export on the server.
Also, be sure that the NFS server allows access from the host for the desired export.
Manually Mounting
Mounting NFS shares to the client is done using the mount command, in a similar fashion to mounting local file systems.
mount -t nfs4 -o options host:/remote/path/ /local/mount/point
For example: To mount an export '/var/data' on host '10.10.1.10' to the local directory '/remote/data', the following command would be used.
mount -t nfs4 10.10.1.10:/var/data /remote/data
The '-t nfs4' can usually be dropped completely. You'll now be able to access the remote directory under '/remote/data' as though it were part of the local filesystem.
For information on the various mount options, which can improve transfer performance and permissions, refer to the nfs man page.
man nfs
Mount via fstab
NFS mounts can also be specified within the /etc/fstab file for ease of mounting, and mounting on system startup. The format is the same as with local mounts.
host:/remote/path /local/mount/point nfs4 defaults 0 0
For the previously used example export, this would be:
10.10.1.10:/var/data /remote/data nfs4 defaults 0 0
yum install nfs-utils
Additionally, the 'portmap' service must be running and enabled.
service portmap start
chkconfig portmap on
To mount the share, you'll need the following information.
The hostname, domain name, or IP of the NFS server.
The full path of the export on the server.
Also, be sure that the NFS server allows access from the host for the desired export.
Manually Mounting
Mounting NFS shares to the client is done using the mount command, in a similar fashion to mounting local file systems.
mount -t nfs4 -o options host:/remote/path/ /local/mount/point
For example: To mount an export '/var/data' on host '10.10.1.10' to the local directory '/remote/data', the following command would be used.
mount -t nfs4 10.10.1.10:/var/data /remote/data
The '-t nfs4' can usually be dropped completely. You'll now be able to access the remote directory under '/remote/data' as though it were part of the local filesystem.
For information on the various mount options, which can improve transfer performance and permissions, refer to the nfs man page.
man nfs
Mount via fstab
NFS mounts can also be specified within the /etc/fstab file for ease of mounting, and mounting on system startup. The format is the same as with local mounts.
host:/remote/path /local/mount/point nfs4 defaults 0 0
For the previously used example export, this would be:
10.10.1.10:/var/data /remote/data nfs4 defaults 0 0
Nginx is a lightweight, fast, and efficient web and proxy server. It is one of the fastest static conent web servers available, and can also be deployed to delivery dynamic content through a FastCGI interface. In addition, nginx is a very powerful reverse proxy (frontend) server and very capable software load balancer.
For a full listing of features, please refer to http://nginx.org.
Installation
Installation of the latest stable release of nginx can be done easily with the EPEL (Extra Packages for Enterprise Linux) package repository. To use this repository, execute the following as the root user:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Once the EPEL repository is in use, nginx can be easily installed through yum.
yum install nginx
Configuration
Nginx uses the configuration file /etc/nginx/nginx.conf, which can be edited using nano. Virtual hosts (web sites) are configured in this file with 'server' code blocks, which are located under the main 'http' block. The default 'server' block will listen on port 80, and has a document (web root) of '/usr/share/nginx/html'.
To help explain configuration of the server block, below is a very basic entry.
server {
listen 80;
server_name www.domain.com domain.com;
location / {
root /var/www/domain.com/html;
index index.html index.htm;
}
}
listen: Specifies the port on which this virtual host listens.
server: Lists the host headers for the site.
location /: Specifies how to handle requests under the location '/', the site root.
root: The document root for the site.
index: An ordered priority list of default documents.
For further details and examples on nginx's configuration, please refer to their offical wiki page and core documentation.
Note: If your server currently is configured with another web server, you'll likely need to have Nginx listen on a port other than 80. This is done simply by editing the 'listen' setting in the default server block, as well as any additional server blocks that are created.
To test your configuration, execute the following and it will report on any errors.
/usr/sbin/nginx -t
Starting and Testing
Once you've setup a working configuration, you can start the nginx server.
/etc/init.d/nginx start
If using the default document root (/usr/share/nginx/html), visiting your server's IP in a browser should yield the default server page.
nginx_test
Now that Nginx is running successfully, you'll want to be sure it's added to the default run level so it will start automatically at boot time.
chkconfig nginx on
For a full listing of features, please refer to http://nginx.org.
Installation
Installation of the latest stable release of nginx can be done easily with the EPEL (Extra Packages for Enterprise Linux) package repository. To use this repository, execute the following as the root user:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Once the EPEL repository is in use, nginx can be easily installed through yum.
yum install nginx
Configuration
Nginx uses the configuration file /etc/nginx/nginx.conf, which can be edited using nano. Virtual hosts (web sites) are configured in this file with 'server' code blocks, which are located under the main 'http' block. The default 'server' block will listen on port 80, and has a document (web root) of '/usr/share/nginx/html'.
To help explain configuration of the server block, below is a very basic entry.
server {
listen 80;
server_name www.domain.com domain.com;
location / {
root /var/www/domain.com/html;
index index.html index.htm;
}
}
listen: Specifies the port on which this virtual host listens.
server: Lists the host headers for the site.
location /: Specifies how to handle requests under the location '/', the site root.
root: The document root for the site.
index: An ordered priority list of default documents.
For further details and examples on nginx's configuration, please refer to their offical wiki page and core documentation.
Note: If your server currently is configured with another web server, you'll likely need to have Nginx listen on a port other than 80. This is done simply by editing the 'listen' setting in the default server block, as well as any additional server blocks that are created.
To test your configuration, execute the following and it will report on any errors.
/usr/sbin/nginx -t
Starting and Testing
Once you've setup a working configuration, you can start the nginx server.
/etc/init.d/nginx start
If using the default document root (/usr/share/nginx/html), visiting your server's IP in a browser should yield the default server page.
nginx_test
Now that Nginx is running successfully, you'll want to be sure it's added to the default run level so it will start automatically at boot time.
chkconfig nginx on
Subscribe to:
Posts (Atom)