Forums

Resolved
0 votes
Hi Everyone

I've been running ClearOS Professional 6.x since September 2014 - now running 6.9.0

Version
ClearOS Professional release 6.9.0 (Final)
Kernel Version
2.6.32-696.30.1.v6.x86_64

It has been working realy well for our small company needs - basically Gateway - firewall with mail server, mail archive, multi-wan, intrusion protection, anti-virus and fail2ban. It continues to do everything that we need, but I will be looking to change over to ClearOS 7.x in the forseeable future.

The one thing that has been putting me off is the Mail Archive - since September 2014 we have archived some 4.5 million emails and this number has become a bit unmanagaeble - searches take really long and I am now running out of disk space as the ibdata1 file in mysql has now reached 260GB - which I am assuming is due to the Mail Archive.

What I would really like to do is archive some of the Mail Archive - e.g. keep only the last two years as current mail archive and create a historical archive of the rest - it would obviously be desirable to still be able to access these older emails if necessary.

When I move across to ClearOS 7.x it will be necessary to still be able to access the old Mail Archive - ideally it would probably be desirable for it to live on an external Hard Drive so it does not affect the core system.

Has anybody done anything like this before? I have no knowledge of the mysql database, and because of the size of this file, it currently is not even possible for me to back it up.

Thanks in advance
Monday, March 04 2019, 03:09 PM
Share this post:
Responses (7)
  • Accepted Answer

    Wednesday, March 06 2019, 05:10 PM - #Permalink
    Resolved
    0 votes
    Nick Howitt wrote:

    I've just knocked it up on my system and you should not have had to have done all that. If you go to the Webconfig > Server > MySQL Server, the link there takes you to https://your_lan_IP:81/mysql and this is allowed by default. Then you log into either the Main Database or the System Database. There is no need to directly access ports 3306 and 3308, but I guess you can if you want.


    I agree, and that's what the documentation says too - BUT there is no MySQL Server link in my menu...been like this since installation in 2014. So it is - I at least have access now, thank you.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 06 2019, 02:05 PM - #Permalink
    Resolved
    0 votes
    I've just knocked it up on my system and you should not have had to have done all that. If you go to the Webconfig > Server > MySQL Server, the link there takes you to https://your_lan_IP:81/mysql and this is allowed by default. Then you log into either the Main Database or the System Database. There is no need to directly access ports 3306 and 3308, but I guess you can if you want.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 06 2019, 10:53 AM - #Permalink
    Resolved
    0 votes
    Nick Howitt wrote:

    I believe you get the PHPMyAdmin if you install the MySQL server.


    The phpMyAdmin was not installed by default, so once the repository issue was fixed (thank you) I installed the phpMyAdmin package. I'll put in all the steps in case anybody else needs the information:

    yum install -y  phpMyAdmin


    I set the symbolic link for http access:

    ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin


    and tried to access it via web browser https://localip/phpadmin - only to get the Error 403 Forbidden error message

    I found out from some internet research that only localhost access is allowed by default, and this needed to be changed in the phpMyAdmin.conf file which should have been in /etc/httpd/conf-d/ - but this file was not created during the installation.

    phpMyadmin.conf file created with

    vi /etc/httpd/conf-d/phpMyAdmin.conf


    and inserted the following:


    Alias /phpMyAdmin /usr/share/phpMyAdmin
    Alias /phpmyadmin /usr/share/phpMyAdmin

    <Directory /usr/share/phpMyAdmin></Directory>
    AddDefaultCharset UTF-8

    <IfModule mod_authz_core.c>
    # Apache 2.4
    Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
    # Apache 2.2
    Order Deny,Allow
    Deny from All
    Allow from localIP1
    Allow from localIP2
    Allow from localIP3
    </IfModule>
    </Directory>


    removing case sensitive www logon, and allowing access from my local IPs, and not only localhost.

    Restarted Apache server:

    service httpd restart


    Restarted with no errors, and now I can access the phpMyAdmin form my localIP web browser.

    logged on to System database with "root", and retrieved the password using:

    cat /var/clearos/system_database/root


    Now I can see all my databases in phpMyAdmin, and my plan is to create a second Mail Archive database and move all older emails to that one, and then take it offline
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, March 05 2019, 02:30 PM - #Permalink
    Resolved
    0 votes
    I believe you get the PHPMyAdmin if you install the MySQL server.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, March 05 2019, 12:17 PM - #Permalink
    Resolved
    0 votes
    It seems the MySQL app only works with ClearOS 7.x ... I can not select it in My Marketplace.

    From the command line :


    mysql> show databases;
    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | mail_archive |
    | mysql |
    | reports |
    | roundcubemail |
    +--------------------+


    and looking at the details :


    mysql> SELECT table_schema "mail_archive",
    -> ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
    -> FROM information_schema.tables
    -> GROUP BY table_schema;
    +--------------------+---------------+
    | mail_archive | DB Size in MB |
    +--------------------+---------------+
    | information_schema | 0.0 |
    | mail_archive | 222776.0 |
    | mysql | 0.6 |
    | reports | 690.4 |
    | roundcubemail | 0.5 |
    +--------------------+---------------+
    5 rows in set (1.51 sec)
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, March 05 2019, 11:02 AM - #Permalink
    Resolved
    0 votes
    Nick Howitt wrote:

    My guess would be a crash course in SQL. Start with the MySQL app. I think in 6.x you have to add a small config to access the system-mysql database on port 3308, but I can't remember. I'd need to investigate further, You may have a reasonable chance if it is a single table. If it is multiple tables, I'm not sure what to do, and I've never seen the app.


    thank you Nick - I was afraid that may be the answer ;) ... let me have a look and see what I can decipher, hopefully without breaking it ...
    The reply is currently minimized Show
  • Accepted Answer

    Monday, March 04 2019, 09:19 PM - #Permalink
    Resolved
    0 votes
    My guess would be a crash course in SQL. Start with the MySQL app. I think in 6.x you have to add a small config to access the system-mysql database on port 3308, but I can't remember. I'd need to investigate further, You may have a reasonable chance if it is a single table. If it is multiple tables, I'm not sure what to do, and I've never seen the app.
    The reply is currently minimized Show
Your Reply