Friday, November 22, 2019

Ampps: start Apache from terminal on CentOS

In order to start Apache for Ampps from terminal run the following command:

/usr/local/ampps/apache/bin/httpd -k start


If you get the following error:

/usr/local/ampps/apache/conf/httpd.conf: No such file or directory

 - that means you'll have to run Ampps and start Apache first time from there in order to create the configuration file.

If you see this:

/usr/local/ampps/apache/bin/httpd: symbol lookup error: /usr/local/ampps/apache/lib/libapr-1.so.0: undefined symbol: dlopen

- follow these instructions.

Ampps 3.8: Apache won't start on CentOS

If Apache won't start from Ampps 3.8 on CentOS, close Ampps and perform the following commands in terminal as root:

cd /usr/local/ampps/apache/lib

mkdir bck

mv ./libapr* ./bck/

yum -y install apr-util-devel libnsl


After that you can start Ampps and it should launch Apache.

Source

VirtualBox guest additions installation on CentOS 8

Here's what I did:

1. Disabling SELinux

sudo nano /etc/selinux/config

- change this line:

SELINUX=enforcing

to:

SELINUX=disabled

2. Reboot.


3. Install the required packages

yum install tar bzip2 make automake gcc gcc-c++ kernel-devel elfutils-libelf-devel

4. Reboot.


5. Insert guest additions from the virtual machine's menu: Devices >> Install Guest Additions and follow the installation steps.

Sunday, November 17, 2019

Installing Node 13.1.0 on a Linux shared hosting

Here's a set of SSH commands for Node 13.1.0 installation on a shared hosting:

mkdir node

cd node

curl -O http://nodejs.org/dist/v13.1.0/node-v13.1.0-linux-x64.tar.gz

tar -xvzf node-v13.1.0-linux-x64.tar.gz --strip-components=1

export PATH=$HOME/node/bin:$PATH

echo 'export PATH=$HOME/node/bin:$PATH' >> ~/.bashrc



To check if it's working use:

node -v

If you need a different Node version, you can find it here and replace the URL and file name in the curl and tar commands.

HTTP_X_FORWARDED_PROTO fix for WordPress

Websites behind load balancers or reverse proxies that support HTTP_X_FORWARDED_PROTO can be fixed by adding the following code to the wp-config.php file, above the require_once call:

/* Fixing Wordpress & WooCommerce SSL issues */
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
    $_SERVER['HTTPS'] = 'on';
}

Monday, October 24, 2016

Qihoo stops 360 Yunpan (Cloud Drive) service


Recently Qihoo 360 announced the upcoming closure of their Yunpan Cloud Drive service due to piracy and pornography issues.

According to the announcement uploading should be disabled on November 1, 2016.
Service will stop on February 1, 2017.




360云盘服务转型公告
日エ元法解決的盗版侵板等岡岳回題。360云岳即将零空企当z本暖 务,同时停止个人版云盘,将在2016年11月1日起停止上传服 务,在2017年2月1日起关闭服务,请及时下载和备份数据,感谢
您的一路相伴。


Thursday, October 20, 2016

Removing ads from KMPlayer

To remove adds from KMPlayer on Windows, add the following code at the end of hosts file, which is usually located in C:\Windows\System32\drivers\etc folder:

127.0.0.1 player.kmpmedia.net
127.0.0.1 log.kmplayer.com
127.0.0.1 cdn.kmplayer.com
127.0.0.1 cdn.pandora.tv


Then, in order to remove the sidebar, create an empty index.htm file and move it to \KMPlayer\Logo folder.

That's it.

Monday, February 1, 2016

Drush on Windows localhost: getting "Failed to get available update data from ..." error

Sometimes, when trying to install a new module with Drush on Windows local server, for example, Administration menu module:

>drush en admin_menu -y

you may see an error like:

simplexml_load_file(): I/O warning : failed to load external entity    [warning]

"" Project.php:72
Failed to get available update data from                                 [error]

https://updates.drupal.org/release-history/admin_menu/7.x



To avoid this, uncomment, or add the following line in php.ini file:

extension=php_openssl.dll

and then restart your server.

Thursday, December 24, 2015

How to enable shared folders on VirtualBox CentOS guest

1. Add shared folders for the virtual machine in Settings -> Shared Folders, select Auto-mount option.
2. Start your virtual machine, the shared folders should be mounted in /media section with sf_prefix.
To make them accessable for a non-root user add this user to vboxsf groupe

sudo usermod -a -G vboxsf username


- replace username here with the actual user name;
- restart the guest, and the shared folders should be available.

Here is another method.

Drupal 7: Enabling comments for all nodes at once


To enable comments for all nodes at once use the following query:


UPDATE `node` SET comment = 2 WHERE comment = 1;
UPDATE `node_revision` SET comment = 2 WHERE comment = 1;

Wednesday, December 16, 2015

SELinux: allowing write access to a directory for Apache user to get rid of "Directory not writable" errors

Apart from setting write permissions with chmod, the following SELinux label should be set for the directory to be writable by Apache:
unconfined_u:object_r:httpd_sys_rw_content_t:s0

For example:

chcon -R unconfined_u:object_r:httpd_sys_rw_content_t:s0 /var/www/html/your_directory

-R stands for "recursively" here.

Thursday, November 26, 2015

Installing Drush on Windows

One of these packages can be used for Windows installation:

6.0
6.6.0
7.0.0 (stable)

As I've already had my XAMPP with Apache server running in C:\xampp, I've changed drush.bat to include path to XAMPP's php folder:

@echo off

SET SCRIPT_HOME=%~dp0
SET PATH=%SCRIPT_HOME%tools\bin;%PHP_PATH%;%PATH%

@php.exe "%SCRIPT_HOME%vendor\drush\drush\drush.php" --php="php.exe" %*

Monday, May 25, 2015

Prestashop 1.6. 2 errors 1. The route is not valid / 2. Route to modules : Incorrect value

Issue in SEO & URLs section of Prestashop:

2 errors

    The route is not valid
    Route to modules : Incorrect value




You might get such errors when you try to save settings in SEO & URLs, even if nothing has been changed:



The reason of the error could be .htaccess file permissions on the server.
By default it's 644:
Change it to 604:

Then save SEO & URLs settings again. If everything is fixed, you'll see "The settings have been successfully updated" message:

Prestashop 1.6.0.14. Warning on line 381 in file /classes/Language.php


How to fix the following error in Prestashop 1.6.0.14:

Warning on line 381 in file /classes/Language.php
[2] file_exists(): open_basedir restriction in effect. File(/themes/theme_name/modules/index.php/translations/es.php) is not within the allowed path(s): (/home/username:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp)



Open /classes/Language.php file, and change line 381:

if ($module !== '.' && $module != '..' && $module !== '.svn' && file_exists($tPath_from.'modules/'.$module.'/translations/'.(string)$iso_from.'.php'))

to:

if ($module !== '.' && $module != '..' && $module !== '.svn' && @file_exists($tPath_from.'modules/'.$module.'/translations/'.(string)$iso_from.'.php'))

Thursday, March 5, 2015

Magento: upload HTTP error

Such error may appear when you try uploading images via Magento admin panel. In order to fix it use the following settings in Configuration > Web > Session validation settings:


Magento error: the directory is not writable by server.

Sometimes when such error occurs, for example during the image upload in Magento admin panel, it can be fixed by creating "wysiwyg" directory in the /media folder.

If this doesn't help, you may also need to adjust some configuration options.

Saturday, January 17, 2015

Enabling OpenSSL on XAMPP

Here is how to enable OpenSSL on XAMPP:

1. Open php.ini file in XAMPP/php folder.
2. Find the line:

;extension=php_openssl.dll

and remove ; at the beginning.

3. Save the file and restart Apache

Wednesday, October 29, 2014

Public DNS

The Google Public DNS IP addresses (IPv4) are as follows:
  • 8.8.8.8
  • 8.8.4.4
The Google Public DNS IPv6 addresses are as follows:
  • 2001:4860:4860::8888
  • 2001:4860:4860::8844
More detailed explanation on the Google's official documentation page.

Find public DNS servers in China

Friday, April 4, 2014

Converting images to PDF in Linux


Simplest way to convert images to PDF file:

convert /path_to_images/*.png document.pdf

"convert" command is part of the ImageMagick package, most Linux distributions come with.

It's possible to reduce the file size by changing color map with "-colors" option. For example, changing number of colors used in PDF images to 256:

convert /path_to_images/*.png -colors 256 document.pdf

Sunday, March 30, 2014

Compiling on Linux


Open terminal as a regular user, not root.
Essentially, all you need is executing the following 3 commands:

./configure
make
sudo make install

Few possible issues 


Source files should be extracted on a Linux file system, and not as root, otherwise you may see the error:

./configure: Permission denied 
 


configure: error: cannot run C compiled programs
 
make sure that you have "build-essential" package installed,
and don't use 'configure' or 'make' with 'sudo'.



User is not in the sudoers file. This incident will be reported

This means you need to add the current user to /etc/sudoers file, for example by opening it for editing as root and adding this:

user    ALL=(ALL:ALL) ALL

(replace "user" with your actual user name).

Tuesday, November 5, 2013

Fixing "no input file specified" error with .htaccess or php.ini


This error usually occurs on goDaddy hosting, because of the way they have PHP installed.

Method 1: Quick fix for Joomla and Magento on Apache server with .htaccess

The following method should work if you get "No input file specified" error message while installing a content management or eCommerce system on Apache server. It can be Joomla, Magento, or other platform that uses "index.php" as part of SEO friendly URLs.

Add the code below to your .htaccess file in the directory of your site on the server.

If you don't have .htaccess file there, just create a text file on your computer, paste the code, upload it to your server, and rename it to ".htaccess":

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^index.php/(.*)$ [L]


Note: if your site is not in the root of your domain name,
for example, in a subfolder named "yourdirectory":
http://yourDomain/yourDirectory/
then replace this:

RewriteBase /

with:

RewriteBase /yourDirectory/

Method 2: Fixing "No input file specified" error by editing php.ini file

The following should work if PHP runs in CGI mode, like on shared/Deluxe hosting from goDaddy.

Add the following to php.ini (or create a text file, paste the code, upload to the root directory of your site and rename it to php.ini):

cgi.fix_pathinfo = 1

Note for goDaddy users
If your site is hosted with goDaddy, the file should be named php5.ini.

If you uploaded a new php5.ini file, instead of editing the existing one, most likely it won't take effect right away, it should start working after the server is rebooted.

You may try to speed this up as explained here:
Why isn't my php.ini file taking effect?

Monday, October 1, 2012

Tutorial: Installing osCommerce on WampServer

First of all, get WampServer from here

Install it with Apache, MySQL, PHP, phpMyAdmin. Skip the steps related to uploading files to your hosting, as your Wamp will be running locally on your computer.

Create a new database for your future local site (in phpMyAdmin).

Download osCommerce Online Merchant from here

Extract the files somewhere on your computer.

Copy the content of the "catalog" folder to the web root folder of your server (wamp/www directory).

Start Apache and MySQL, navigate to your local site, for example, if you have osCommerce files in folder wamp/www/catalog, the link to your site will be http://localhost/catalog

Follow the installation guide.

At the end you'll be able to see the site, for example, by opening the link http://localhost/catalog

To login to your admin panel just add "admin": http://localhost/catalog/admin