Linux CHMOD Change user & group ownership

Learn how to change the owner and group ownership of files and directories with the chown and chgrp commands. Caution: you need to do this whiled logged in as 'root' user. In order to set the ownership of a directory and all the files in that directory, you'll need the -R option: $ chown -R username somedir Here, R stands for recursive because this command will recursively change the ownership of directories and their contents. After issuing this example command, the user username will be the owner of the directory somedir, as well as every file in that directory. Tell what happens: $ chown -v username somefile changed ownership of 'somefile' to username Here, v stands for verbose. If you use the -v option, chown will list what it did (or didn't do) to the file. The verbose mode is especially useful if you change the ownership of several files at once. For example, this could happen when you do it recursively: $ chown -Rv username somedir changed ownership of 'somedir/' to username changed ownership of 'somedir/boringfile' to username changed ownership of 'somedir/somefile' to username The options of using chgrp are the same as using chown. So, for example, the -R and -v options will work with it just like they worked with chown: $ chgrp -Rv usergroup somedir changed group of 'somedir/' to usergroup changed group of 'somedir/boringfile' to usergroup changed group of 'somedir/somefile' to usergroup chown nicely reports to you what it did to each file.

Share

Postfix Setup

In webmin >Severs > Postfix mail server > Edit config file, change this small line-

inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost

The significance is- if you don’t uncomment inet_interfaces =all, your server is completely isolated from the network. It won’t listen other than the server or localhost. In order to check if the settings are ok- you need to connect to your server from a networks pc. Open ‘cmd’ in your pc and type-

telnet X.X.X.X 25

If something returns- then its ok, else if it’s Unable to connect, you need to make the above changes I’ve mentioned.

Postfix on most systems is very nearly ready for use as the mail server for the Virtual Servers module. The only thing missing is the configuration for a virtual mapping database and, if using quotas, moving the spool directory to the same partition that user data lives on. The first can be added easily using Webmin. Browse to Postfix:Virtual Domains. Enter a type of database, and a filename for the virtual map database into the Domain mapping lookup tables field. Generally, this will be something along the lines of hash:/etc/postfix/virtual. In this example the type is a dbm hash, and the filename is virtual in the /etc/postfix directory. Save and apply your change.

Next, you’ll need to move your mail spool to the /home partition. Browse to the Postfix:Local Delivery module. Edit the Spool directory option and enter /home/mail. Save and Apply your changes.

It is useful to choose mail as the subdirectory here, because there will already exist a mail user on most systems and so there is no way to accidentally create a new user that would end up getting your mail spool as their home directory! If you don’t use Red Hat Linux, you should probably first check to be sure there is a user named mail on your system (I believe most UNIX systems do have a user of this name).

In order for POP or IMAP to work, those servers will need to know how to find the mail spool. The easiest thing to do for this is probably to create a symbolic link from /var/spool/mail to /home/mail. The command to do this:

# ln -s /home/mail /var/spool/mail

That’s it!

Share

A small tweek in MySQL Data path in Linux using webmin

By default all database and data are stored in /var/lib/mysql

But whenever, you’re planning to setup a virtual hosted server, it is wise to set up and configure this db to be set up in some different bigger disk space. Like I use to place this data path to /home/mysql

How to change this using webmin

  • From your webmin Servers > MySQL Database Server > MySQL Server Configuration section look for-
  • Database files directory = /var/lib/mysql
  • Now change this to-
    Database files directory = /home/mysql
  • A small reminder- don’t forget to create “mysql” directory in /home location!
  • It’s done!

You have changed the data storage path!

Precaution:
It is recommended to modify or update this mysql data path on a fresh installation- without any cpanel or virtualmin server is hosted.

And also don’t you forget to restart the MySQL service after this changes are made! Happy data organizing!!! 😛

Share

Setting up PHPMyAdmin to Usermin Module

Webmin and Usermin are simply great- but it lacks the most widely used PhpMyadmin support! However, after googling for a while I got a solution for this.

First need to download and setup the usermin module- here’s the URL for wbm package-

http://awstats.sourceforge.net/files/phpmyadmin-1.0.wbm

How to install PHPMyAdmin Module ?

  • Go to Usermin > usermin Module
  • insert the above URL to the text box- “From ftp or http URL”
  • Click “Install module from file”. The module will be installed
  • Then go Usermin > Usermin module configuration section
  • Select “Mysql Database (PHPMyAdmin)”
  • PHPMyAdmin URL to open- enter your full server name (default fqdn name such as http://ns4.geospacehosting.com/phpadmin)
  • It’s done!

Next to configure Apache

  • Go to Webmin > Servers > Apache Webserver
  • Click “Default Server”
  • Click “Alias and Redirects”
  • In “Document Directory Aliases” section- enter From “/phpadmin” To “/etc/phpadmin”. This actually means- http://ns4.geospacehosting.com/phpadmin or any virtual hosted domain such as https://tweenpath.net/phpadmin (here tweenpath.net is the vhosted server)
  • Click “Apply Changes”
  • It’s done!

Most important but the core PHPMyAdmin upload and configuration

  • You need to upload the PHPMyAdmin utility software package to “/etc/phpadmin”, i.e. to the target hosting server
  • Open “config.inc.php” file with a text editor like emacs
  • find [‘auth_type’] and enter “http” as authentication
  • It’s done!
Share

User Disk Quota in Linux using Webmin- essentials for Hosting Web Hosting Platform

Quotas on Linux are tricky, not because they are difficult to setup, but because they are so poorly documented, and what documentation exists is more often than not incorrect to the point of not working. If you are using a relatively recent Linux version, the following instructions should work without difficulty.

Prior to Linux Installation:

Yes, a major & key point in Linux Partition is /home directory.

VHost is widely setup on almost all control panel mechanism on /home location, since
– Users & Groups
– FTP server
– User shell
– Apache and all that other directives are constructed on this /home partition

So, home should be created as a Logical Volume on a Linux native File system (ext3). In my later section, I’d assume there is already a /home partition (and it’d also wise to have this partition as much disk space as you want to give away to your clients. Because, even mails and even mysql data will also be stored in this volume.

Step-1
System > Disk & Network Filesystems

On the System > Disk & Network Filesystem you’ll get something like this-

On the “Mounted As” column select “/home” to go to next screen which is similar as below-

Down below to “ext2/ext3 specific options section” look for the options “Use Quotas?” and select “User and Group” from the drop down menu.

Click “SAVE” and you’re almost done!

Step-2
System > Disk Quotas

Once you completed the above step, you should find something similar like-

On “Action” column, click “Enable Quotas

You’re done! And that’s it! I’m sorry nothing more to do.

Are Quotas Working?

To test to be sure your quotas are actually enabled, you can use the “repquota /home” utility to see what the current quota usage looks like. It should looke something like this:

Share

Working with FC-5, Webmin, Usermin & Virtualmin (GPL) PART-3 USERMIN

Usermin:

Installation
Method-1:
Step by step installation (Complicated and usually I do not follow) guide available on the followin URL-

http://www.linuxjunkies.org/adminstration%20Howto/webminguide/x804.htm

Method-2: (My Way):
Installation within Webmin.

  1. Under “Un-used Modules” from the left frame
  2. “Usermin Configuration” hyper link
  3. Install usermin RPM package

Configuration:

Actually there’s nothing much to configure on usermin other than setting up webmail and few links not to show your clients!

After installation- it is very hard to locate Usermin within Webmin! but you can find them 🙂

  1. You can find usermin by typing “usermin” from the webmin search box
  2. You can directly access the Usermin module by http://IP:10000/usermin

But do no access to http://IP:20000 the usual usermin client panel- you can not configure usermin module from here. You can configure once you are logged in to webmin framework.

You can customize your usermin whatever fits your need. I did the following from my setups-

  1. Usermin Module coniguration > Read Mail
    Sendmail mail file location = /home/mail
    Mail storage format for Inbox = Sendmail style single file (mbox)
    Mail subdirectory style= mail/username
  2. Available Modules (see the scrren shot)

That’s it! Seeya in the next chapter 😐

Share

Working with FC-5, Webmin, Usermin & Virtualmin (GPL) PART-2 WEBMIN

Webmin

Well, webmin is a composite word “Web Based Admin”- literally speaking, those who scares the terminal configurations, they can try working with this Webmin.

Webmin is something that I use for-

  • Configuring and Administering SQUID Proxy server
  • Configuring & Administering NAT Routing or even you can setup a soft router instead of a costly Router devices
  • Configuring & Administering the LAMP servers
  • Create different admin level for different tasks
  • Configuring and Administering HSP system

Basically, to me Webmin is kind of a “Framework” system- like an umbrella that allows other modules, applications/APIs to be incorporated like their own Usermin or Virtualmin. Anyone can work on this project and can write modules CGI applicaiton. It’s entirely written in Perl (shell coding).

There are plenty of potentials in Webmin- I also did used this for Asterisk (IP-PBX) and Jabber (XMPP Messenger server).

Here’s what they’d like to say on their site-

Webmin is a web-based interface for system administration for Unix. Using any browser that supports tables and forms (and Java for the File Manager module), you can setup user accounts, Apache, DNS, file sharing and so on.

Webmin consists of a simple web server, and a number of CGI programs which directly update system files like /etc/inetd.conf and /etc/passwd. The web server and all CGI programs are written in Perl version 5, and use no non-standard Perl modules.

So, this is enough what webmin is, visit them- http://www.webmin.com

Share

Working with FC-5, Webmin, Usermin & Virtualmin (GPL) PART-1

Yes, here’s teh mammoth task I’ve decided to write down with automate task with- Fedora Core-5, Webmin, usermin and Vitualmin. this is part-1, I don’t know how many parts will there be in documenting up these tasks.

Well, first let me explain why all these…

Locating the business model:

Probably this is the biggest reason of why to look for such options. Well, I’m quite familiar with PLESK on Windows 2003 platform. I also have a seperate plan on documenting PLESK installation and maintenance on Windows Hosting Automation.

Yup, the words already mentioned- Hosting Automaiton. We actually we going to materialize the Hosting business quite lately, after the B/w cost minimizaiton and few potentials to get better B/w. As a part of this, I did set up 3 Hosting Control Automation System as HSP (Hosting Service Provider) on windows 2003 server- 2 located in Dhaka and 1 located in London.

All those platforms are running just superb! The biggest credit was the licensing issue… once received those, it took me no time to set up and running.

So, there goes all those 3 set ups… now what about the little penguin- are we all neglecting or forgetting this “Penguin”- LINUX and its hosting automation?

Of course not! But C-Panel is costly!!!!

Why should we bother when the perfect OS is entirely free but there is not Hosting Automation Applicaiton available other than C-Panel? Actually, C-Panel is popular, widely used by mass of HSP and the biggest point is plenty of API tools & goodies are developed widely!

Anyway, FREE HSP is the cheapest, and if we can ignore the last point I just mentioned- we can plan to set up Virtualmin on Webmin framework!

Chosing the OS:

Well, here’s the most important aspect in choosing the right OS. And again anyone have any liberty in putting up any Linux Distros- Redhat 9 or Enterprise 5 or Fedora 5 & onwards or CentOS 4 & onwards… most likely all have the same output- but if you ask me for commercial executions- I’ll definitely consider Redhat Enterprise or CentOS- the reason is simple- Slow paced but most Stable developments rather than FC packages (it’s the most non-balanced platform).

Then why the heck did I plan to work on FC-5 where FC-9 is released? The answer is quite simple- limited resource on the server. I picked to work on a Pentium-3 machine having only 256 MB RAM and I with this I can’t afford more than FC-5 installation! 🙂

Summary:

Well enough of intros. Let me explain the step by step prerequisites to set up a Hosting Control Panel (HSP)-

  • Server OS- Fedora Core 5
    Software package- Apache, MySQL, Webalizer, ProFTPD (installation distribution does not include this, you have to use “YUM INSTALL PROFTPD” on the terminal once FC installation is done), Postfix, Dovecot- POP3 & IMAP, BIND
  • Download and install the latest version of webmin (http://www.webmin.com) when OS is done. Usually I prefer the RPM packages, if you install FC on GUI interface, you can set it up like any other windows setup application by double clicking the RPM file. Normally, webmin is installed in http://IP:10000 or https://IP:10000
  • Log in to Webmin using the username as “root” and your root password
Share