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.


Topics - andreambrosio

Pages: [1]
1
Varnish / Varnish problem with woocommerce
« on: March 01, 2023, 02:02:07 PM »
I'm configuring Verniz to use woocommerce and I made some changes to the "default.vcl" file to separate the cache for mobile and desktop because my site appears different on mobile, this is the code:

Code: [Select]
vcl 4.0;
backend default { .host = "144.126.137.13"; .port = "8181";}
include "/etc/varnish/conf.d/vhosts.conf";
## ## Not complete default.vcl code

# Routine to try and identify device
sub identify_device {
# Default to thinking it's desktop
set req.http.X-UA-Device = "desktop";

if (req.http.User-Agent ~ "iPad" ) {
# It says its a iPad - so let's give them the tablet-site
set req.http.X-UA-Device = "tablet";
}

else if (req.http.User-Agent ~ "iP(hone|od)" || req.http.User-Agent ~ "Android" || req.http.User-Agent ~ "Windows Phone" || req.http.User-Agent ~ "[ (]BlackBerry;") {
                # It says its a iPhone, iPod, Android  or BlackBerry - so let's give them the touch-site..
                set req.http.X-UA-Device = "smartphone";
    }

else if (req.http.User-Agent ~ "Kindle" || req.http.User-Agent ~ "^nook browser") {
set req.http.X-UA-Device = "ereader";
}

else if (req.http.User-Agent ~ "SymbianOS" || req.http.User-Agent ~ "^BlackBerry" || req.http.User-Agent ~ "^SonyEricsson" || req.http.User-Agent ~ "^Nokia" || req.http.User-Agent ~ "^SAMSUNG" || req.http.User-Agent ~ "^LG" || req.http.User-Agent ~ "IEMobile" || req.http.User-Agent ~ "Windows CE") {
# Some other sort of mobile
set req.http.X-UA-Device = "mobile-other";

}

sub vcl_recv {
  call identify_device;
}

sub vcl_hash {
    hash_data(req.url);
    if (req.http.X-UA-Device){
      # Add device info with uniqueID cache
      hash_data(req.http.X-UA-Device);
    }
    if (req.http.host) {
        hash_data(req.http.host);
    } else {
        hash_data(server.ip);
    }
    return (lookup);
}

# Unset Cookies except for WordPress admin and WooCommerce pages
if (!(req.url ~ "(wp-login|wp-admin|carrinho|cart|add-to-cart|minha-conta/*|wc-api*|checkout|escritorio-virtual|addons|logout|lost-password|produto/*)")) {
unset req.http.cookie;
}
# Pass through the WooCommerce dynamic pages
if (req.url ~ "^/(carrinho|cart|add-to-cart|minha-conta/*|escritorio-virtual/*|checkout|wc-api/*|addons|logout|lost-password|product/*)") {
return (pass);
}
# Pass through the WooCommerce add to cart
if (req.url ~ "\?add-to-cart=" ) {
return (pass);
}
# Pass through the WooCommerce API
if (req.url ~ "\?wc-api=" ) {
return (pass);
}
# Block access to php admin pages via website
if (req.url ~ "^/phpmyadmin/.*$" || req.url ~ "^/phppgadmin/.*$" || req.url ~ "^/server-status.*$") {
error 403 "For security reasons, this URL is only accesible using localhost (127.0.0.1) as the hostname";
}

But now the server is not booting and I can't solve it, can someone help me? I am posting the error log below:

Code: [Select]
● varnish.service - Varnish Cache, a high-performance HTTP accelerator
   Loaded: loaded (/usr/lib/systemd/system/varnish.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2023-03-01 07:55:27 CST; 5min ago
  Process: 4116 ExecStart=/usr/sbin/varnishd -P /var/run/varnish.pid -f $VARNISH_VCL_CONF -a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} -S $VARNISH_SECRET_FILE -s $VARNISH_STORAGE $DAEMON_OPTS (code=exited, status=255)
 Main PID: 30643 (code=exited, status=0/SUCCESS)

Mar 01 07:55:27 server.ayanlife.com varnishd[4116]: Found: 'if' at
Mar 01 07:55:27 server.ayanlife.com varnishd[4116]: ('/etc/varnish/default.vcl' Line 50 Pos 1)
Mar 01 07:55:27 server.ayanlife.com varnishd[4116]: if (!(req.url ~ "(wp-login|wp-admin|carrinho|cart|add-to-cart|minha-conta/*|wc-api*|checkout|escritorio-virtual|addons|logout|lost-password|produto/*)")) {
Mar 01 07:55:27 server.ayanlife.com varnishd[4116]: ##----------------------------------------------------------------------------------------------------------------------------------------------------------
Mar 01 07:55:27 server.ayanlife.com varnishd[4116]: Running VCC-compiler failed, exited with 2
Mar 01 07:55:27 server.ayanlife.com varnishd[4116]: VCL compilation failed
Mar 01 07:55:27 server.ayanlife.com systemd[1]: varnish.service: control process exited, code=exited status=255
Mar 01 07:55:27 server.ayanlife.com systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Mar 01 07:55:27 server.ayanlife.com systemd[1]: Unit varnish.service entered failed state.
Mar 01 07:55:27 server.ayanlife.com systemd[1]: varnish.service failed.

I really need this help

2
Problems on other RedHat linux servers / Problem disk Quota
« on: December 12, 2022, 09:43:21 PM »
I need some help, the disk quota is saying it's full but the client package is set to unlimited, I've tried everything but all accounts are full, can anyone help?

https://prnt.sc/2-OkLnx2M1Fa
https://prnt.sc/O2O21EYw-tk7

I am unable to do anything. My VPS still has more than 200gb of space but it is saying that users have exceeded quotas.

3
Information / problem domain
« on: February 24, 2022, 09:30:38 PM »
I have a problem with a domain. I'm trying to add it to my server but the following message appears "Domain mydomain.com already exists on the server!"

But he is not added to any account. How do I resolve this?

4
Apache / Apache webserver error
« on: January 13, 2019, 08:03:39 PM »
I'm having this problem in Webserver, can anyone tell me how I solve it please?

Quote
● httpd.service - Web server Apache
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2019-01-13 17:01:01 -03; 15s ago
  Process: 26451 ExecStart=/usr/local/apache/bin/apachectl start (code=exited, status=1/FAILURE)

Jan 13 17:01:01 server.idealistic.com.br systemd[1]: Starting Web server Apache...
Jan 13 17:01:01 server.idealistic.com.br apachectl[26451]: AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf.d/ssl.conf:9
Jan 13 17:01:01 server.idealistic.com.br apachectl[26451]: AH00112: Warning: DocumentRoot [/home/andrem/public_html/] does not exist
Jan 13 17:01:01 server.idealistic.com.br apachectl[26451]: AH00526: Syntax error on line 274 of /usr/local/apache/conf.d/vhosts-ssl.conf:
Jan 13 17:01:01 server.idealistic.com.br apachectl[26451]: SSLCertificateFile: file '/etc/pki/tls/certs/marketing.andreambrosio.com.br.cert' does not exist or is empty
Jan 13 17:01:01 server.idealistic.com.br systemd[1]: httpd.service: control process exited, code=exited status=1
Jan 13 17:01:01 server.idealistic.com.br systemd[1]: Failed to start Web server Apache.
Jan 13 17:01:01 server.idealistic.com.br systemd[1]: Unit httpd.service entered failed state.
Jan 13 17:01:01 server.idealistic.com.br systemd[1]: httpd.service failed.

5
E-Mail / Problem with dovecot
« on: July 10, 2017, 02:39:43 PM »
I'm trying to start dovecot but this error and it looks like failed, I'm trying to get into the email using the roundcube and I can not, can anyone help me?


Jul 10 11:38:09 server.ideacomunicacao.com.br systemd[1]: Starting Dovecot IMAP/POP3 email server...
Jul 10 11:38:09 server.ideacomunicacao.com.br systemd[1]: Started Dovecot IMAP/POP3 email server.
Jul 10 11:38:09 server.ideacomunicacao.com.br dovecot[26367]: doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 105: ssl_cert: Can't open file /etc/pki/tls/certs/server.ideacomunicacao.com.br.crt: No such file or directory
Jul 10 11:38:09 server.ideacomunicacao.com.br systemd[1]: dovecot.service: main process exited, code=exited, status=89/n/a
Jul 10 11:38:09 server.ideacomunicacao.com.br systemd[1]: Unit dovecot.service entered failed state.
Jul 10 11:38:09 server.ideacomunicacao.com.br systemd[1]: dovecot.service failed.

6
CentOS-WebPanel Bugs / Server error, I can not log in
« on: June 09, 2017, 12:21:48 AM »
The server was working normal, and nothing stopped, the screen appears normal (http://server.ideacomunicacao.com.br/) but when I try to log it is loading (http://server.ideacomunicacao.com.br:2030) But it does not carry, does anyone know what has happened?

We sites gives error, (http://www.promolover.com.br/)

Help me please.

7
PHP / PHP INTL
« on: February 03, 2017, 01:23:19 PM »
Hello, I installed a server with CentOS 7 and CWP, I need to install PHP INTL, but it does not work, and I tried several commands and it does not work, does anyone know how to install php7 with intl?

I'm installing Mautic, and I'm creating an account for it, it appears that it has the intl extension but the mautic does not recognize it, as if it had disabled.

8
SSL / erro ssl let's encrypt
« on: January 27, 2017, 02:55:45 AM »
I'm trying to install ssl plus the following error appears ( Unable to read or file empty /etc/scl/prefixes/python27!)

I already did the tutorial that sent this

To solve it:

1- First install python requirements
$yum install epel-release
$rpm -ivh https://rhel6.iuscommunity.org/ius-release.rpm
yum --enablerepo=ius install git python27 python27-devel python27-pip python27-setuptools python27-virtualenv -y
2- Workaround for missing files
$ echo /opt/rh > /etc/scl/prefixes/python27
$mkdir /opt/rh/python27
$touch /opt/rh/python27/enable

This solve for me the problem with the Unable to open: /etc/scl/prefixes/python

Then i got another problem virtualenv not found, this can be solved using symbolink link
$cd /usr/bin
$ln -s  virtualenv-2.7  virtualenv

on the 64bit version you dont need to do anything as it works fine

But it says that the directory no longer exists, how should I proceed, I use a centos 32bits.

Pages: [1]