New in CWP Edge / LTSFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers. Available now in the Edge-Latest and LTS-Stable versions. Discuss in the forum

LSPHP / Cache ›
CWP Secure KernelKernel-level protectionEvery site in its own sandbox

Every PHP site, cron job and SSH session runs in its own profile that the kernel enforces. A hacked WordPress cannot read other accounts’ files, and crypto miners and unexpected processes are stopped. Discuss in the forum

Secure Kernel ›
CWP DataCenter PanelFree for CWPpro serversAll your servers on one screen

Manage all your CWP servers from one panel: live health, every hosting account, CWP and OS updates on many servers at once, backups, SSL, firewall and Telegram alerts. Discuss in the forum

DataCenter Panel ›
CWP Backup ServerFree for CWPpro serversBackups that ransomware cannot reach

Protected backups of all your CWP servers on a separate machine. Snapshots a hosting server cannot delete, and restore of files, databases, mail and whole accounts in the admin and user panel. Discuss in the forum

Backup Server ›
WordPress ManagerIncluded & freeWordPress managed from the panel

Install, secure, update, back up and clone WordPress sites without FTP. Updates are tested on a staging clone first and applied to the live site only when they pass, with a backup taken first. Discuss in the forum

WordPress Manager ›
CWP CageIsolationEvery account in its own cage

Per-account isolation built from Linux namespaces and cgroups. A break-in or a runaway script on one site cannot reach another account, the panel or the rest of the server; resource limits per hosting package. Discuss in the forum

CWP Cage ›
Script InstallerOne-click appsWordPress, Joomla, Moodle and more in one click

CWP’s own script installer in the user panel: pick an app, choose the domain and folder, and it is live in seconds with its database and admin login created automatically. Ready for LSPHP and LSAPI-Cache. Discuss in the forum

Script Installer ›
DNS ClusterFor every control panelOne DNS cluster for all your servers

Your servers keep creating domains as usual; the zones are collected into one authoritative PowerDNS cluster you control, with DNSSEC, roles and a full activity trail. Accepts CWP, cPanel, Plesk, DirectAdmin and BIND. Discuss in the forum

DNS Cluster ›
CWP BillingFree to useBilling and support system for hosting providers

Clients, services, invoices, payments, domains, server provisioning and support tickets in one place. All gateways, server modules and registrars are free, with free migration from WHMCS, ClientExec and Blesta. Discuss in the forum

CWP Billing ›
CWPproFrom $1.49 per monthEvery CWP feature unlocked

CWPpro is the professional version of Control Web Panel: all features, unlimited accounts, the latest CWP version and security fixes first. $1.49 per month or $11.99 per year. Discuss in the forum

Get CWPpro ›

Enable CORS

Started by Diego, November 17, 2014, 03:46:25 PM

Previous topic - Next topic

Diego

I have recompiled apache to include the headers module and it worked fine.
But when I add
Header set Access-Control-Allow-Origin "*"
to the httpd.conf file, nothing changes?
I still can't get cors enabled.

thanks

Administrator

can you provide the full paths of the files which you are editing, this is very important?

MyBuddyBen

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

QuoteLoaded 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
Trying to help people :)
Chords and Lyrics

Administrator

you should use apache rebuilder tool to rebuild apache with additional required mods.