Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MyBuddyBen

Pages: 1 2 3 [4] 5
46
Apache / Re: Enable CORS
« on: March 22, 2016, 02:28:14 PM »
I'm wanting to enable CORs too.. But Mod_headers isn't included in apache, and I'm having the hardest trouble trying to add that module somehow.

I'm basically wanting to be able to put this in the vhosts or httpd.conf
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin: *
</IfModule>

But apache doesn't have mod_headers.c

so I search for it and make a file and paste the contents of mod_headers.c
I then do
/usr/local/apache/bin/apxs -c mod_headers.c

To try adding it to apache and it goes through some of the process, but stops with a bunch of errors

Quote
/usr/local/apache/bin/apxs -c mod_headers.c
/usr/lib64/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool' mod_headers.so /usr/lib64/httpd/modules
/usr/lib64/apr-1/build/libtool --mode=install cp mod_headers.so /usr/lib64/httpd/modules/
libtool: install: cp mod_headers.so /usr/lib64/httpd/modules/mod_headers.so
cp: cannot stat `mod_headers.so': No such file or directory
apxs:Error: Command failed with rc=65536
.
[root@mail ~]# /usr/local/apache/bin/apxs -c mod_headers.c
/usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/local/apache/include  -I/usr/include/apr-1   -I/usr/include/apr-1   -c -o mod_headers.lo mod_headers.c && touch mod_headers.slo
mod_headers.c:84:21: error: ap_expr.h: No such file or directory
mod_headers.c:133: error: expected specifier-qualifier-list before 'ap_parse_node_t'
mod_headers.c: In function 'header_inout_cmd':
mod_headers.c:401: error: 'ap_parse_node_t' undeclared (first use in this function)
mod_headers.c:401: error: (Each undeclared identifier is reported only once
mod_headers.c:401: error: for each function it appears in.)
mod_headers.c:401: error: 'expr' undeclared (first use in this function)
mod_headers.c:508: error: 'header_entry' has no member named 'expr'
mod_headers.c: In function 'do_headers_fixup':
mod_headers.c:647: error: 'header_entry' has no member named 'expr'
mod_headers.c:649: error: 'header_entry' has no member named 'expr'
mod_headers.c:650: error: 'ap_expr_string' undeclared (first use in this function)
mod_headers.c: At top level:
mod_headers.c:911: warning: data definition has no type or storage class
mod_headers.c:911: warning: parameter names (without types) in function declaration
mod_headers.c:911: error: function 'AP_DECLARE_MODULE' is initialized like a variable
mod_headers.c:913: error: invalid initializer
mod_headers.c:913: error: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:913: warning: excess elements in scalar initializer
mod_headers.c:913: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:913: warning: excess elements in scalar initializer
mod_headers.c:913: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:913: warning: excess elements in scalar initializer
mod_headers.c:913: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:913: warning: excess elements in scalar initializer
mod_headers.c:913: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:913: warning: excess elements in scalar initializer
mod_headers.c:913: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:913: warning: excess elements in scalar initializer
mod_headers.c:913: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:913: warning: excess elements in scalar initializer
mod_headers.c:913: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:914: warning: excess elements in scalar initializer
mod_headers.c:914: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:915: warning: excess elements in scalar initializer
mod_headers.c:915: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:916: warning: excess elements in scalar initializer
mod_headers.c:916: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:917: warning: excess elements in scalar initializer
mod_headers.c:917: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:918: warning: excess elements in scalar initializer
mod_headers.c:918: warning: (near initialization for 'AP_DECLARE_MODULE')
mod_headers.c:920: warning: excess elements in scalar initializer
mod_headers.c:920: warning: (near initialization for 'AP_DECLARE_MODULE')
apxs:Error: Command failed with rc=65536


My CWP loaded modules

Quote
Loaded Modules:
 core_module (static)
 authn_file_module (static)
 authn_default_module (static)
 authz_host_module (static)
 authz_groupfile_module (static)
 authz_user_module (static)
 authz_default_module (static)
 auth_basic_module (static)
 include_module (static)
 filter_module (static)
 deflate_module (static)
 log_config_module (static)
 env_module (static)
 unique_id_module (static)
 setenvif_module (static)
 version_module (static)
 ssl_module (static)
 mpm_prefork_module (static)
 http_module (static)
 mime_module (static)
 status_module (static)
 autoindex_module (static)
 asis_module (static)
 suexec_module (static)
 cgi_module (static)
 negotiation_module (static)
 dir_module (static)
 actions_module (static)
 userdir_module (static)
 alias_module (static)
 rewrite_module (static)
 so_module (static)
 cloudflare_module (shared)
 h264_streaming_module (shared)
 flvx_module (shared)
 rpaf_module (shared)
 suphp_module (shared)



Headers nowhere to be found. I'd appreciate any help to get this working so I can add headers again, via vhosts, httpd.conf, and htaccess

47
New Modules / Re: Migrate CWP->CWP
« on: February 19, 2016, 02:32:13 PM »
This could be easily done with a couple of steps. Sadly I don't have the "know how" to put it in PHP form and make it execute the shell commands.

*Before rsync-ing ANYTHING, do it with "rsync --dry-run" so it only tests it, and not actually perform the rsync. Best to do this over and over until there isn't a single error.

1) Rsync everything from old server to new server (With the exceptions of "etc/fstab" "etc/network*" "backup*" "proc*" "tmp*" "sys*" "dev*" "mnt*" "boot*" "root*") with the options of -auHxvz and --numeric-ds
2) Need to mysqldump everything to an "all_databases.sql" (Otherwise CWP won't work since the core is in a database) and import it on the new server. Also make note of your old "Phpmyadmin" password, because that will remain the same. You will need that to import the "all_databases.sql" on the new server.
3) Need to copy the users, and groups from the old server to the new server (etc/passwd and etc/group files)
4) Login to new server with your NEW Root password. Remember that it's not the same as the old server.
5) Edit apache v-hosts, apache config, apache SSL vhosts, shared IP address at the bottom of homepage, with the new IP address. Also set your hostname to what your old server use to be. It's best this way. For example if your old server was s1.domain.com and your new server is currently set to s2.domain.com; after reaching this step update your DNS record for s1 to be the new server's IP and wait for it to go through.

I actually just did this myself, so that's how I know it works. I did notice FTP server number doesn't show up on the homepage now. So that may have fallen off. Not sure, I could ask igor to look at it and see what didn't migrate over and note it here for research purposes.

If you notice something wrong with my information, please do correct me. :) I want to be resourceful for future readers.

48
Apache / Need HTTP/2 support with Apache
« on: February 19, 2016, 01:50:29 PM »
As you may or may have not heard, Chrome will drop support for SPDY SSL in May. So it's best practice to go ahead and upgrade your ssl protocol to HTTP/2, sadly the apache version (2.2.27) that comes with CWP doesn't support HTTP/2 I believe. Correct me if I'm wrong.

But we need the next version of CWP to support HTTP/2 SSL.
Unless you can provide documentation below of how we can go ahead and do it ourselves. :)

Thanks!

49
New Modules / [module] Cloudflare - Simple 1-click install or uninstall
« on: January 07, 2016, 03:46:39 PM »
NOTICE: DO NOT INSTALL YET, there is an issue! Please wait for next version

This is a very fast, and easy way to one-click install Cloudflare apache module and also to remove it from the httpd.conf if you want. I'd like you to test and confirm it worked for you as it has for me.  ;D I did write this, so it's bound to have something wrong, so please look over it and see what you think.

Features:
- One-Click install or Uninstall Cloudflare from Apache
- Checks to see if Cloudflare is already installed Apache
- You will need to restart apache after installing cloudflare, do this from the CWP Dashboard.
- Restores Original Visitor's IP address to your server logs

NOTICE: DO NOT INSTALL YET, there is an issue! Please wait for next version
I just tried doing it on a new server and it REALLY messed up the apache.... :( I'm not going to go deeper in this because I think I misunderstood how this works. Basicly what you need is to install cloudflare with the mod_cloudflare.so then add the
LoadModule cloudflare_module  /usr/lib64/httpd/modules/mod_cloudflare.so
to your /usr/local/apache/conf/httpd.conf and restart apache. I was trying to install httpd-devel which I think messes it all up bad. You can read more here about installing cloudflare (https://www.cloudflare.com/resources-downloads/).

Perhaps someone can branch this code I started and make it better or perfect.


Latest Version: 1.1

Screenshots



Installation
Add this line to:
/usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php
Quote
<li><a href="index.php?module=cloudflare"><span class="icon16 icomoon-icon-arrow-right-3"></span>Cloudflare</a></li>



Then create a new file called "cloudflare.php" on:
/usr/local/cwpsrv/htdocs/resources/admin/modules
with this content:
Quote
<center><h2>Cloudflare Apache Module Installer</h2><h3>Version: 1.1</h3><a href="http://forum.centos-webpanel.com/new-modules/(module)-cloudflare-simple-1-click-install-or-uninstall/" target="_blank"><button type="button" class="btn btn-primary">Check for Update</button></a><hr></center>
<?php
$file = '/usr/local/apache/conf/httpd.conf';
$searchfor = 'LoadModule cloudflare_module  /usr/lib64/httpd/modules/mod_cloudflare.so';

// get the file contents, assuming the file to be readable (and exist)
$contents = file_get_contents($file);
// escape special characters in the query
$pattern = preg_quote($searchfor, '/');
// finalise the regular expression, matching the whole line
$pattern = "/^.*$pattern.*\$/m";
// search, and store all matching occurences in $matches
if(preg_match_all($pattern, $contents, $matches)){
   echo "<p class='text-success'>Cloudflare is installed already!</p>\n
   <form action='' method='post'>
<button type='submit' name='uninstall' class='btn btn-danger'>Uninstall Cloudflare</button>
</form>
   ";
}
else{
   echo "
    <center><strong>Run these commands as root in SSH terminal</strong></center>
    <pre>
mkdir /usr/local/cwpsrv/htdocs/resources/admin/modules/cloudflare
cd /usr/local/cwpsrv/htdocs/resources/admin/modules/cloudflare
wget https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c
apxs -a -i -c mod_cloudflare.c
   </pre>
   
   Then click the green button below; then afterward go to the CWP Dashboard and Restart Apache
   
   <p class='text-success'>Cloudflare is not installed!</p>\n
   
   <form action='' method='post'>
<button type='submit' name='install' class='btn btn-success'>Install Cloudflare</button>
</form>";
}

?>
<?php
if(isset($_POST['install']))
{

//Add Cloudflare module to Apache
$path_to_file = '/usr/local/apache/conf/httpd.conf';
$file_contents = file_get_contents($path_to_file);
$file_contents = str_replace("# LoadModule foo_module modules/mod_foo.so","# LoadModule foo_module modules/mod_foo.so \nLoadModule cloudflare_module  /usr/lib64/httpd/modules/mod_cloudflare.so",$file_contents);
file_put_contents($path_to_file,$file_contents);
echo "<center><h4>Go to CWP Dashboard and Restart Apache!</h4></center><br><br>
<h5>Refreshing page in 5 seconds to verify Cloudflare was installed.....</h5>
<meta http-equiv='refresh' content='5' />";

}

if(isset($_POST['uninstall']))
{

//Remove Cloudflare module to Apache
$path_to_file = '/usr/local/apache/conf/httpd.conf';
$file_contents = file_get_contents($path_to_file);
$file_contents = str_replace("LoadModule cloudflare_module  /usr/lib64/httpd/modules/mod_cloudflare.so","",$file_contents);
file_put_contents($path_to_file,$file_contents);
echo "<center><h4>Go to CWP Dashboard and Restart Apache!</h4></center><br><br>
<h5>Refreshing page in 3 seconds to verify Cloudflare was uninstalled.....</h5>
<meta http-equiv='refresh' content='3' />";

}
?>

50
New Modules / [module] Speedtest your server in 30 seconds
« on: January 06, 2016, 08:30:37 PM »
This quickly and effectly uses the speedtest.net servers to test your server's internet bandwidth connection. Check to see if you're really getting what your provider says you should get!

Features:
- Speed test your server within 30 seconds
- Uses the connection from speedtest.net
- NO buttons to click, auto runs on page and live updates to show the speed
- Detects and uses the server closest to your server's geolocation

Latest Version: 1.1a

Add this line to:
/usr/local/cwpsrv/htdocs/resources/admin/include/3rdparty.php

Quote
<li><a href="index.php?module=speedtest"><span class="icon16 icomoon-icon-arrow-right-3"></span>Speed Test</a></li>


Then create a new file called "speedtest.php" on:
/usr/local/cwpsrv/htdocs/resources/admin/modules
with this content:
Quote
<center><h3>Speed test your server's internet connection</h3><h2>Verison 1.1a</h2><br>
Python file provided by Speedtest.net<br>
<button type="button" class="btn btn-warning" onclick='window.location.reload(true);'>Restart Test</button>

<a href="http://forum.centos-webpanel.com/new-modules/(module)-speedtest-your-server-in-30-seconds/" target="_blank"><button type="button" class="btn btn-primary">Check for Update</button></a><br><br></center>
<pre>
<?php

$command = "python /usr/local/cwpsrv/htdocs/resources/admin/modules/speedtest/speedtest.py 2>&1";
$pid = popen( $command,"r");
while( !feof( $pid ) )
{
 echo fread($pid, 256);
 flush();
 ob_flush();
 usleep(100000);
}
pclose($pid);
?>
</pre>

Then run this command from your Terminal/SSH Window (You can copy and paste this; Do the last empty line too ;) )
Quote
mkdir /usr/local/cwpsrv/htdocs/resources/admin/modules/speedtest
cd /usr/local/cwpsrv/htdocs/resources/admin/modules/speedtest
wget -O speedtest.py https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod 755 speedtest-cli.py
chmod +x speedtest-cli.py
echo Complete!



Now just load the page Developer Menu -> Speedtest from the sidebar and you will begin the speed test.
Which will be /index.php?module=speedtest

51
How to / Re: Fastest Way of Enabling Mod_PageSpeed
« on: August 13, 2015, 05:55:46 PM »
Thanks! Could you make a removal script tutorial too? Like to undo everything your install tutorial says? That way there is a simple way to reverse it if the user wants to remove it?

Best to do that on other tutorials you do too  ;) Then they are pretty much perfect

Thanks again for taking time to make this!  ;D

52
Addons / Re: Team Speak 3 - Manager
« on: June 19, 2015, 02:29:36 PM »
I get the same error as mentioned above.

Quote
[Fri Jun 19 10:26:07 2015] [error] [client ###.###.##.##] PHP Notice:  Undefined offset: 0 in /usr/local/cwpsrv/htdocs/resources/admin/modules/ts3_manager.php(1) : eval()'d code(1) : eval()'d code on line 6, referer: http://###.##########:2082/index.php?module=ts3_manager

Replaced sensitive data with ### for privacy.
I have 64 bit centos, and installed the Teamspeak 3 64bit through the index.php?module=ts3_manager page. Just gives the error above after installing then it just says

############### Server Status ###############
Server seems to have died
#######################################

No server running (ts3server.pid is missing)

What is the issue and how can we solve it?

53
How to / How to Force a Backup (Run Daily backup command)
« on: February 04, 2015, 09:18:40 PM »
Simply run this command via SSH with Root.

If you get a error 7, you need to turn on DAILY BACKUP in your CWP (/index.php?module=backups) then try again.

/usr/local/cwp/php54/bin/php -d max_execution_time=1000000 -q /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php

54
Information / Re: Executing an immediate backup?
« on: February 04, 2015, 09:10:55 PM »
The new code to "force a backup" is this
/usr/local/cwp/php54/bin/php -d max_execution_time=1000000 -q /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php

Take notice that the command Admin mentioned above says to pull from /etc/webpanel/
But I noticed that folder doesn't even exists on my server. So I peeked into this file (http://dl1.centos-webpanel.com/files/cwp-latest) and saw the command I just gave, which excutues the "Backup" script.

55
E-Mail / Email "alias" root don't work
« on: February 04, 2015, 01:58:15 AM »
When you do the *** Put a * to forward all email
it doesn't catch any email.
I've tried and it just doesn't forward the emails at all.
I had to create a mailbox and login in order to see the emails being sent because it wouldn't forward all the emails for that domain to my gmail account.

I'm running a fresh install of 0.9.7.
One of my clients said that if you use a specific alias (like webmaster@example.com) it will work. But if you do *@example.com it doesn't work.


56
SSL / Re: PCI Compliance
« on: February 03, 2015, 04:28:23 PM »
Agreed! Is there a way to make sure the VPS is PCI compliant? Maybe a test button perhaps?

57
Migration from other control panels / Re: Migration from Plesk
« on: February 03, 2015, 04:26:44 PM »
Currently, there isn't a way to import emails, or email inboxes, even from cPanel.
Only files and directories, along with the MySQL (Databases and Users) are importable, and that's if you're using cPanel.

Maybe they will add plesk migration in a future build ;)

58
Information / Re: How add parked domains
« on: February 03, 2015, 04:24:14 PM »
I don't see parked domains as a feature in the current build of CWP.

59
CentOS Configuration / Re: How to setup user quotas ?
« on: February 02, 2015, 02:21:05 PM »
Can someone do a YouTube video of how to do this?  ;D It would help me a bunch!

60
Apache / Re: Report: Missing domain in vhosts.conf
« on: February 02, 2015, 01:50:33 PM »
Fixed it.

Somehow apache was installed by a third party on centos, and that was messing with CWP.
So I used the "rebuild apache" in CWP, let it run. Deleted the "addon domains" and readded them and viola! It added them to the vhost and started working  ;D

Hope this helps someone else having trouble like I did.

Pages: 1 2 3 [4] 5