Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Move directory to its own partition?

Discussion in 'General Discussion' started by ca2236, Apr 5, 2018.

  1. ca2236

    ca2236 Well-Known Member

    Joined:
    Feb 2, 2018
    Messages:
    45
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Nebraska
    cPanel Access Level:
    DataCenter Provider
    Hello,

    I know this is more a centos question than a cpanel question, however, our server is getting low on space on our partition format. I've traced it down to the mysql databases and backups that are happening for the sites.

    Since this machine is a vm, I was able to add a new partition easy enough.

    Here are my questions:

    1) since the mysql directory is technically on an lvm partition, is there any danger in forcing that partition to mount (via fstab and normal means) to the new drive, which would probably not be added into the lvm partition scheme (unless it should be done)

    2) since it the mysql databases and backups, I presume there would be a setting that I need to change in cpanel settings?


    I will continue doing more research, but I thought I would ask the experts here.

    Thanks
     
  2. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    372
    Likes Received:
    21
    Trophy Points:
    93
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @ca2236


    I can't speak for your specific configuration but the following forum threads have addressed similar issues and may be useful for you:

    the proper way to move mysql to a second drive
    how to move mysql data directory

    If the instructions to move the MySQL to a different drive are followed there shouldn't be anything necessary to modify for that, if backups are also going to be moved to this drive you may want to modify the backup configuration at WHM>>Backup>>Backup Configuration to store the backups on the new drive.


    Thank you,
     
  3. ca2236

    ca2236 Well-Known Member

    Joined:
    Feb 2, 2018
    Messages:
    45
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Nebraska
    cPanel Access Level:
    DataCenter Provider
    Hello,

    Thanks for your reply. I found it really helpful. :) I have a couple of follow up questions if I may.

    1) Since it appears that there are logs in the domlogs in /var/logs for the time period where the account was over quota. Does that mean, apache is logging the connections still under /var/log, but it can't write back to the account for awstats due to the account being over quota?

    2) if we use log rotation for the domlogs or the logs that the metrics come from, does the rotated out data not exist in the metric history? I would assume so, but wanted to check.


    Thanks
     
  4. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    372
    Likes Received:
    21
    Trophy Points:
    93
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    I'm really happy you found it helpful!

    The logs are in /var/log/apache2/logs/domlogs/DOMAIN (there's also a symbolic link to this at /etc/apache2/logs) when statistics are run these are collected by the metrics software and then depending on the configuration placed in the user's homedir - the statistics themselves are updated in /home/$user/tmp/awstats /home/$user/tmp/webalizer etc. If these can't be written too the stats won't update.

    Well, the answer to this depends on your settings. If you've selected in Tweak Settings "Archive logs in the user's home directory at the end of each stats run unless configured by the user." and "Remove the previous month's archived logs from the user's home directory at the end of each month unless configured by the user" is off then you will have logs indefinitely. If you've selected on then you will only have the previous month's
     
  5. ca2236

    ca2236 Well-Known Member

    Joined:
    Feb 2, 2018
    Messages:
    45
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Nebraska
    cPanel Access Level:
    DataCenter Provider
    One last question (I hope) :)

    Once the quota issue is resolved, is it possible to feed the logs back into the webalizer? I thought I would ask before trying to download a third party metric analyzer.
     
  6. ca2236

    ca2236 Well-Known Member

    Joined:
    Feb 2, 2018
    Messages:
    45
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Nebraska
    cPanel Access Level:
    DataCenter Provider
    Well, after looking back at the metric page, I found that the missing months are in there, so it must get generated if the log files are still there.
     
  7. ca2236

    ca2236 Well-Known Member

    Joined:
    Feb 2, 2018
    Messages:
    45
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Nebraska
    cPanel Access Level:
    DataCenter Provider
    Is there a way to old logs into the server to be re-indexed by the metrics?
     
  8. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    372
    Likes Received:
    21
    Trophy Points:
    93
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hello,

    It is possible but it's a bit of a process. Here is how we do it:

    extract the old log file copy the run the stats program manually against it, then move the resultant file to the correct flle name for that month:

    Code:
    cd /home/cPUser/tmp/awstats
    
    cp /home/cPUser/logs/domainname.tld.bkup-Mon-20YY.gz 
    
    gzip -d domainname.tld.bkup-Mon-20YY.gz
    
    /usr/local/cpanel/3rdparty/bin/awstats.pl -config=/home/cPUser/tmp/awstats/awstats.domainname.tld.conf -LogFile=/home/cPUser/tmp/awstats/domainnamed.tld.bkup-Mon-20YY
    
    mv awstatsMM20YY.domainname.tld.txt awstatsMM20YY.domainname.tld.txt.bak
    
    mv awstatsMM20YY.txt awstatsMM20YY.domainnamed.tld.txt
    
    chown cPUser awstatsMM20YY.domainname.tld.txt
    
    Above: replace MON with the Month (Jan, Feb, Mar, etc...), replace cPUser with the cPanel Username, domainname.tld with the domain name, MM with the month (01,02,03, etc...) and 20YY with the year.

    Thank you,
     
  9. ca2236

    ca2236 Well-Known Member

    Joined:
    Feb 2, 2018
    Messages:
    45
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Nebraska
    cPanel Access Level:
    DataCenter Provider
    Thanks for the steps! :)
     
  10. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    372
    Likes Received:
    21
    Trophy Points:
    93
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @ca2236

    You're very welcome! I hope it helps you get everything back to order!
     
  11. ca2236

    ca2236 Well-Known Member

    Joined:
    Feb 2, 2018
    Messages:
    45
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Nebraska
    cPanel Access Level:
    DataCenter Provider
    I apologize, I think I mixed up my posts. The web analyzer follow up questions should have gone on my other post.
     
  12. ca2236

    ca2236 Well-Known Member

    Joined:
    Feb 2, 2018
    Messages:
    45
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Nebraska
    cPanel Access Level:
    DataCenter Provider
    I have a follow up question on the moving directories around.

    is it possible to relocate /var/lib/mysqlbackup by changing the path in the configs? (I think its possible by mounting a new partition/disk in that location via fstab) but wanting to actually move the directory path.
     
  13. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    372
    Likes Received:
    21
    Trophy Points:
    93
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @ca2236

    /var/lib/mysqlbackup is not a default path your actual MySQL directory should be /var/lib/mysql. What are you using /var/lib/mysqlbackup for?


    Thank you,
     
  14. ca2236

    ca2236 Well-Known Member

    Joined:
    Feb 2, 2018
    Messages:
    45
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Nebraska
    cPanel Access Level:
    DataCenter Provider
    Hi @cPanelLauren,

    We can close this ticket, its a path we setup for custom I found out. I am wanting to break the awstats steps up above to its own ticket. I will be posting shortly. Thanks!
     
  15. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    372
    Likes Received:
    21
    Trophy Points:
    93
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @ca2236

    I'm glad to hear you were able to find a resolution!
     
Loading...

Share This Page