stuxlogo

Step by step user guide for STUX GNU/Linux (index)

Network services

You can use STUX to provide a variety of network services:

  1. Apache Web server
  2. ProFTP FTP server
  3. PXE Boot server
  4. MySQL
  5. Samba
  6. SSHd
  7. Syslog
  8. Ample (MP3 lender)
  9. ...

Advanced users want surely manage services manually because they know how to do.

Simple users (or lazy advanced users) could use STUX Service Manager, that aggregates the most common network services functions:

  1. configure
  2. start
  3. stop
  4. restart
  5. start / dont't start at boot

  1. STUX Service Manager

    To start STUX Service Manager:
    STUX CONTROL CENTER -> Network -> Services
    A window like this will appear:



    You can see in table the current status of listed services and, for each service, if it must be restarted at boot.

    To handle with a service, right-click on the service: a popup menu will appear:

    • Start
        Start selected service.

    • Stop
        Stop selected service.

    • Restart
        Restart selected service.

    • Start at boot
    • Configure
        Configure selected services.

    1. MySQL

        MySQL is a popular DB engine.

        Setup

        1. To run MySQL server, open the STUX Service Manager, right-click on 'MySQL' service and choose 'Configure' from menu.

          A window like this will appear:



          MySQL directory is the directory where MySQL saves database files, so it has to be large enough and persistent; in STUX Live, default MySQL directory /var/lib/mysql is located in volatile RAM, it's not persistent and usually is not large enough to store MySQL data. So we have to change it. You can keep /var/lib/mysql for demo/testing purposes.

        2. Press button labeled 'Change' and choose a new directory on a real hard disk (example: /mnt/hda2/mysql).

        3. Create MySQL main database, if not already done, pressing button labeled 'Create database'.
          When main database is done, button labeled 'Create database' is re-labeled in 'Drop main database' that can be used to re-initialize MySQL, and is now possible to insert the root MyMSQ username and password, as shown in picture:



        4. It's recomended to set a password for MySQL root user, even if not mandatory.

          If you installed phpMyAdmin (using default settings), the checkbox 'Update phpMyAdmin password' is enabled. If checked, password will be setted also for web application phpMyAdmin.

        5. When done, close the window and go back to STUX Service Manager.

        Start service:

          When main database is created, to run MySQL server, open the STUX Service Manager, right-click on 'MYSQL' service and choose 'Start' from menu.

    2. Apache Web server

        To run Apache Web server, open the STUX Service Manager, right-click on 'HTTP' service and choose 'Start' from menu.

        Test if service is working accessing url http://127.0.0.1: you will see a site like this:



        To configure HTTP service, right-click on 'HTTP' service and choose 'Configure': you will see a window like this:



        This window mainly reports that:

        • server is currently serving pages located locally in /var/www/htdocs/

        • server is currently logging in /var/log/apache/

        • S.S.L. (Secure Socket Layer) is disabled

        Secure HTTP with S.S.L.

          To secure HTTP with S.S.L., you need certificates: certificates are files emitted by Certification Authorities that ensure some levels of privacy between web server and browsers.

          If you don't have a certificate emitted by a Certification Authority, you can generate a certificate by yourself.

          NOTE: creating a certificate auto-certifying its validity, does not compromise privacy; simply, nobody else than you certifies that you are who you are saying to be.
          Connection encryption is guaranteed even if you auto-generate a certificate.


          In the section 'S.S.L. support' (see picture above) there are 3 options:

          1. Enable S.S.L.

            1. Click this button to enable S.S.L..

              If there are no cartificate present, you will be prompted to inteactively create a new one.

              Create the cerificate following instructions.

              If certificate is present, S.S.L. is activated: the button that first was labeled 'Enable S.S.L.' is now labeled 'Disable S.S.L.'.

            2. HTTP service needs to be restarted in order S.S.L. to be used: close the HTTP Configuration window and, in the STUX Service Manager, right-click on 'HTTP' service and click 'Restart' (or 'Start' if was not running).

            3. test S.S.L. pointing your browser at https://127.0.0.1: some warning will appear if certificates have been produced by an unknown authority (by you, in this example): you need to purchase a real certificate to avoid this warning message: click ok to proceed: you will see a secure web site like this picture:




          2. Edit /etc/apache/mod_ssl.conf

              When using S.S.L., instructions in /etc/apache/mod_ssl.conf override some instructions in /etc/apache/httpd.conf:
              for example, for S.S.L. Document Root Directory is not defined in httpd.conf, but in mod_ssl.conf.
              Click this button to edit file /etc/apache/mod_ssl.conf

          3. Certificate

              Click this button to auto-generate S.S.L. certificate.

        Customize Apache web server

          In STUX Service Manager, right-click on 'HTTP' and choose 'Configure' from popup menu; click 'Edit /etc/apache/httpd.conf': this let you edit apache configuration file manually. This requires a base knowledge of apache software.

          • Document Root directory:

              As first thing you need to change Apache Document Root directory, that is the directory that contains the files of your web site: to configure apache for use your local web site (we suppose you keep it in in /mnt/hda1/www), search and replace ALL occurrences of /var/www/htdocs (or the current Apache Document Root directory) with the directory that contains your site (in our example /mnt/hda1/www). To do this, from the text editor menu, choose 'Edit' -> 'Replace', as you can see in the following picture:



              When configuration file is changed, HTTP service needs to be restarted for changes to take effect.

              Now you are serving your web page located, in the example, in directory /mnt/hda1/www.

              Note for S.S.L.: If you are using S.S.L., the Document Root directory is specified in /etc/apache/mod_ssl.conf and not in /etc/apache/httpd.conf, so you need to click on button labeled 'Edit /etc/apache/mod_ssl.conf' instead of button labeled 'Edit /etc/apache/httpd.conf'.

          • Log directory:

              You also want to change the directory where apache writes logs: to do this, replace ALL occurrences of /var/log/apache (or the current directory where apache currently saves logs) with the directory where you want to save log files, as done for customize the Apache Document Root directory.

              Note for S.S.L.: If you are using S.S.L., the Log directory is specified in /etc/apache/mod_ssl.conf and not in /etc/apache/httpd.conf, so you need to click on button labeled 'Edit /etc/apache/mod_ssl.conf' instead of button labeled 'Edit /etc/apache/httpd.conf'.

        Apache and PHP

          PHP is enableb by default in STUX Live.
          Simply put .php files in Document Root Directory and access them with web browser.
          See also Web applications.

    3. ProFTP FTP server

        To run ProFTP FTP server, open the STUX Service Manager, right-click on 'FTP' service and choose 'Start' from menu.

        Test if service is working: open Konqueror browser:
        STUX CONTROL CENTER -> Network -> Browser -> Konqueror
        and insert this URL in the location bar:
        ftp://127.0.0.1
        NOTE: to login to FTP server you need a password because, by default, STUX doen't assign any password. To set password, see section Users and passwords.

        To configure FTP server: open STUX Service Manager, right-click on 'FTP' and choose 'Configure' from popup menu: a window like this will appear:



        This windows reports that:

        1. Anonymous access is currently disabled
        2. Server is logging accesses in /var/log/proftpd.log
        3. Server is logging transfers in /var/log/xferlog

        Buttons:

        • Edit /etc/proftd.conf

          Click this button to manually edit ProFTP configuration file.
          Knowledge of ProFTP software is required to edit this file (full documentation on ProFTPD, including configuration and FAQs, is available at http://www.proftpd.org/)

          It' s recomended to change the log directory /var/log because in STUX Live, /var/log is located in volatile RAM and will be lost on reboot: to do this, click button 'Edit /etc/proftd.conf' and replace all occurrences of /var/log with the persistent directory you choosed, typically on hard disk (example: if you need to save FTP log files in /mnt/hda1/proftpdlog, replace all occurrences of /var/log with /mnt/hda1/proftpdlog).

        • Enable anonymous access

          See Anonymous FTP

      • Anonymous FTP

          Click button 'Enable anonymous access' to enable anonymous access: with anonymous access users can login to FTP server using 'anonymous' as username and no password.

          Useful to serve files where authentication is not required.

          By default, home directory for anonymous users is /home/ftp, but you can change this editing file /etc/proftd.conf, replacing all occurrences of ~ftp with the directory you choose..

      • FTP virtual users

          It is possible to create 'virtual' FTP users.
          Virtual FTP users are not system users, but only FTP users.

          To create FTP virtual user 'bob', with home directory in /mnt/hda2/ftpusers/bob:

          1. create directory for bob in, for example, /mnt/hda2/ftpusers/bob

          2. create password in an alternative password file located in, for example /root/ftpass.txt:
            ftpasswd --passwd --file=/root/ftpass.txt --name=bob --uid=1001 --home=/mnt/hda2/ftpusers/bob --shell=/bin/bash
          3. edit /etc/proftpd.conf and add this line:
            AuthUserFile /root/ftpass.txt
            if not already present, at the end of the file.

          4. if proftpd is already running, reload proftpd configuration: open STUX Service Manager, right-click on 'FTP', choose 'Restart' from popup menu (or 'Start' if was not running).

    4. PXE Boot server

        PXE Boot server is used to boot remote machines.

        Remote machines must support booting from network: if booting from network is not supported from BIOS you can create a boot floppy disk that boots from network.

        If remote machine BIOS does not support booting from network and does not have a floppy drive too, that machine cannot be booted from network.

        PXE Boot server is not properly a service itself, but is a collection of services.

        To configure PXE server: right-click on 'PXE' service and choose 'Configure' from popup menu.
        This will bring you to an interactive menu that let you canfigure PXE server.

        To run PXE boot service, open the STUX Service Manager, right-click on 'PXE' service and choose 'Start' from popup menu.

        Test if service is working: start a remote machine, in the same LAN of STUX Live, configured to boot from network: STUX will be loaded on remote machine.

    5. Samba

        Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients.

        To run Samba service, open the STUX Service Manager, right-click on 'SAMBA' service and choose 'Start' from menu.

        Configuration for Samba server (shares, permissions, etc.) are stored in file
        /etc/samba/smb.conf
        To edit Samba configuration file /etc/samba/smb.conf, open the STUX Service Manager, right-click on 'SAMBA' service, choose 'Configure' from popup menu and press button labeled 'Edit /etc/samba/smb.conf'.
        Base knowledge of Samba configuration is required to edit this file (see also: man samba).

        As example, we'll share directory /usr/doc to everyone: just add this lines at the end of Samba configuration file:
        [docs]
        path = /usr/doc
        public = yes
        only guest = yes
        writable = yes
        printable = no
        
        When configuration file is changed, Samba server needs to be restarted: open the STUX Service Manager, right-click on 'SAMBA' service, choose 'Restart' from popup menu.

        To test service, open STUX Storage Device Manager, choose 'Samba mounts', 'New Samba mount', you will se a window like this:



        This will mount the Samba share created now (//127.0.0.1/docs) under /mnt/newdev.


    6. SSH

        To run SSH shell service, open the STUX Service Manager, right-click on 'SSH' service and choose 'Start' from menu.

        STUX includes Putty as default SSH client: to start Putty:
        STUX CONTROL CENTER -> Network -> SSH client
    7. Syslog

        To run Syslog service, open the STUX Service Manager, right-click on 'SYSLOG' service and choose 'Start' from menu.

    8. Ample (MP3 lender)

        Web site: http://ample.sf.net
        To run Ample service, open the STUX Service Manager, right-click on 'AMPLE' service and choose 'Start' from menu.


There is a public forum about this argument



stuxlogo