468x60

martedì 10 maggio 2016

Viv - incredible next gen AI assistant


venerdì 6 maggio 2016

Install SSL Certificate on Apache for Debian

Prerequisites
OpenSSL installed and updated (should be installed by default)
apt-get update 
apt-get upgrade openssl
Apache will be our HTTPS server. To install it, run the following:
apt-get install apache2
Enable the Apache SSL module
a2enmod ssl
The default Apache website comes with a useful template for enabling SSL, so we will activate the default website now
a2ensite default-ssl
Configure Apache to Use SSL

Edit server configuration file
nano /etc/apache2/sites-enabled/default-ssl.conf
Locate the section that begins with <VirtualHost _default_:443>.
Add a line with your server name directy below the ServerAdmin email line. This can be your domain name or IP address:
ServerAdmin webmaster@localhost 
ServerName example.com:443
Find the following two lines, and update the paths to match the locations of the certificate and key. If you purchased a certificate or generated your certificate elsewhere, make sure the paths here match the actual locations of your certificate and key:
SSLCertificateFile /etc/apache2/ssl/apache.crt 
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
Restart Apache to put these changes into effect
service apache2 restart

mercoledì 16 marzo 2016

Prestashop friendly url

Problemi con i friendly url di Prestashop? Se il webserver è Apache2 fare come segue...

Abilitare il modulo mod_rewrite:
a2enmod rewrite
Modificare il file 000-default.conf:
nano /etc/apache2/sites-enabled/000-default.conf
Nel blocco  alla riga 1 inserire:
 <Directory /var/www/html>  
         Options Indexes FollowSymLinks MultiViews  
         AllowOverride All  
         Order allow,deny  
         allow from all  
 </Directory>  

Riavviare Apache:
service apache2 restart

venerdì 11 marzo 2016

Calculating Median with MySQL

Query per calcolare la Mediana in MySQL
select avg(test_val) as median from
(
select @counter:=@counter+1 as row_id, t1.test_val 
from test100 t1, (select @counter:=0) t2
order by t1.test_val
) o1
join
(
select count(*) as total_rows
from test100
) o2
where o1.row_id in (floor((o2.total_rows + 1)/2), floor((o2.total_rows + 2)/2))

Calcolare la Mediana con MySQL

Query per calcolare la Mediana in MySQL
select avg(test_val) as median from
(
select @counter:=@counter+1 as row_id, t1.test_val 
from test100 t1, (select @counter:=0) t2
order by t1.test_val
) o1
join
(
select count(*) as total_rows
from test100
) o2
where o1.row_id in (floor((o2.total_rows + 1)/2), floor((o2.total_rows + 2)/2))

Installare Apache2+PHP5 su Debian 8

Installare Apache 2
Apache è disponibile come package per Debian, perciò lo possiamo installare come segue:
apt-get install apache2
Ora andare col browser su http://your-server-ip, e dovresti vedere la pagina Apache2 (It works!)

Installare PHP 5
Possiamo installare PHP 5 ed il modulo Apache PHP 5 come segue:
apt-get -y install php5 libapache2-mod-php5
Installare php5-mysqlnd per MySQL
apt-get install php5-mysqlnd
Installare APCu PHP Cache per velocizzare il PHP
apt-get install php5-apcu
Installare altri moduli utili
apt-get -y install php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
Riavviare Apache:
service apache2 restart

lunedì 29 febbraio 2016

Install Apache2+PHP5 on Debian 8

Installing Apache 2
Apache is available as a Debian package, therefore we can install it like this:
apt-get install apache2
Now direct your browser to http://your-server-ip, and you should see the Apache2 placeholder page (It works!)

Installing PHP 5
We can install PHP 5 and the Apache PHP 5 module as follows:
apt-get -y install php5 libapache2-mod-php5
Install php5-mysqlnd for MySQL
apt-get install php5-mysqlnd
Install APCu PHP Cache to improve the PHP speed
apt-get install php5-apcu
Install other useful modules
apt-get -y install php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
Restart Apache:
service apache2 restart
468x60

Cerca su Google

Cerca nel Blog con Google