MilesWeb
MilesWeb Hosting Forum

Please login or register.

Login with username, password and session length

 

News:

SMF - Just Installed!


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 - Manish

Pages: [1]
1
Hello,

Sometimes you get below errors on the CodeIgniter website.

Quote
A PHP Error was encountered

Severity: Warning

Message: mkdir(): Invalid path

Filename: drivers/Session_files_driver.php

Line Number: 117

Backtrace:

File: /home/user/public_html/index.php
Line: 295
Function: require_once
An uncaught Exception was encountered

Type: Exception

Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.

Filename: /home/user/public_html/system/libraries/Session/drivers/Session_files_driver.php

Line Number: 119

Backtrace:

File: /home/user/public_html/index.php
Line: 295
Function: require_once
A PHP Error was encountered

Severity: Warning

Message: fopen(f7a5103144e842f8cafeb2355869ca11dd7ecf48): failed to open stream: Permission denied

Filename: drivers/Session_files_driver.php

Line Number: 156

Backtrace:

To fix the issue follow below steps:

1. Open the config.php file in the directory Codeigniter
2. Find the following code:

Quote
$config['sess_save_path'] = NULL;

3. Change to:

Quote
$config['sess_save_path'] = sys_get_temp_dir();

Your website should be working fine.

That's it  :)

2
Errors and Solutions / How to enable errors on CodeIgniter website
« on: January 12, 2017, 02:02:03 PM »
Hi,

Sometimes you get black page on CodeIgniter website and no errors generated on the server. In such cases you can view the exact errors by enabling the display_errors from index.php file.

Open index.php file and add below code at the end of file

Quote
error_reporting(E_ALL);
ini_set('display_errors', 1);

After that access the website and it will show you exact errors.

3
Hello All,

In Webuzo with ngnix you can enable Gzip compression and Leverage browser caching for particular domain by adding extra configuration file of domain. You will need to create configuration files like gzip.conf and leverage.conf and add below code.

Gzip compression code:

Quote
# Enable Gzip
  gzip  on;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_min_length 1100;
  gzip_buffers     4 8k;
  gzip_proxied any;
  gzip_types
    # text/html is always compressed by HttpGzipModule
    text/css
    text/javascript
    text/xml
    text/plain
    text/x-component
    application/javascript
    application/json
    application/xml
    application/rss+xml
    font/truetype
    font/opentype
    application/vnd.ms-fontobject
    image/svg+xml;

  gzip_static on;

  gzip_proxied        expired no-cache no-store private auth;
  gzip_disable        "MSIE [1-6]\.";
  gzip_vary           on;

Leverage browser caching:

Quote
location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
}

After that Follow below steps:

1: Login to Webuzo panel and go to Domain >> Extra Configuration

2: Select the Domain for which you want to ADD Extra Configuration File.

3: Select the Webserver for which you want to ADD Extra Configuration File.

4: Populate the input field with the location of your configuration file.

5: Click on Add record button.

6: Repeat above steps for other configuration file.

7: Then restart the nginx service on the server.

Ref: http://www.webuzo.com/wiki/Add_Extra_Configuration_File


That's it  :)

4
How To's / Nginx Wordpress Permalinks issue
« on: December 02, 2016, 04:32:18 PM »
Hello,

On Webuzo with nginx, wordpress permalink doesn't work by default. Due to that sub-pages or internal links don't work and they show 404 errors. In such situation we will need to add extra configuration file of domain in nginx.

For that create a custom config file on your computer and add below content in it.

Quote
try_files $uri $uri/ /index.php?q=$uri&$args;

Example: Create permalink.conf file and add provided code in it.

After that Follow below steps:

1: Login to Webuzo panel and go to Domain >> Extra Configuration

2: Select the Domain for which you want to ADD Extra Configuration File.

3: Select the Webserver for which you want to ADD Extra Configuration File.

4: Populate the input field with the location of your configuration file.

5: Click on Add record button.

6: Then restart the nginx service on the server.

Ref: http://www.webuzo.com/wiki/Add_Extra_Configuration_File

That's it. All sub-pages and links should be working fine  :)

5
Errors and Solutions / PHP extensions not loading in phpinfo
« on: July 11, 2016, 09:09:37 AM »
Hi,

Sometimes on cloudlinux server(Cpanel with cloudlinux) PHP extensions doesn't showing in phpinfo even though they are complied with PHP and showing in PHP molues lists. In this case you will need to add particular PHP extension manually by using tool "selectorctl".

"selectorctl" is a new tool that replaces cl-selector (which is deprecated and should not be used anymore) and piniset. It is available starting with CageFS 5.1.3.

Follow below steps:

1) Check all available PHP verisions and native version on server using below command:
Quote
[root@ ~]# selectorctl --summary --show-native-version
4.4 e -
5.1 e -
5.2 e -
5.3 e -
5.4 e -
5.5 e -
5.6 e -

2)Check extension installed for particular PHP version:
Quote
[root@~l]# selectorctl --list-extensions --version=5.6
- apcu
- apm
- ares
- bcmath
- big_int

3)Suppose if you wish to add extension "fileinfo" to version PHP 5.6 run below command:
Quote
[root@~]# selectorctl --enable-extensions=fileinfo --version=5.6

That's it, now check phpinfo file and fileinfo extension will show in it.

6
Hello,

If you face issue with emails getting stucked in mail queue on cpanel server and receive error "All deliveries are handled by MailScanner" when you run mail queue manually then there is issue with the MailScanner installed on the server.

Following steps will fix the Mailscanner issue and can be run in SSH at any time without harm:

  • /scripts/buildeximconf
  • service exim restart
  • /usr/mscpanel/mscheck.pl
When you run above commands on the server result should be as below.


Quote
[root@~]# /scripts/buildeximconf
Configuration file passes test!  New configuration file was installed.
/etc/exim.pl.local installed!
SPF is disabled in exim or unavailable, enabling SPF for SpamAssassin
Mail Scanner exim.conf updating...`/etc/exim.conf' -> `/etc/exim_outgoing.conf'
Done
Refreshing SMTP Mail protection.
SMTP Mail protection has been disabled.  All users may make outbound smtp connections.


Quote
[root@~]# service exim restart
Shutting down exim:                                        [  OK  ]
Shutting down spamd:                                       [  OK  ]
Starting exim:                                             [  OK  ]
Starting exim-outgoing:                                    [  OK  ]
Starting spamd:                                            [  OK  ]


Quote
[root@~]#/usr/mscpanel/mscheck.pl
Generating exim split spool directories...
Updating MailScanner.conf with sensible values...
Shutting down MailScanner daemons:
         MailScanner:
         Waiting for MailScanner to stop..
Starting MailScanner daemons: OK


Once you done this your emails should be working fine.

That's All  :)
   

7
Errors and Solutions / The traceroute problem in CSF servers
« on: June 06, 2016, 07:44:04 PM »
Hello,

In the hosting industry the traceroute   tool is a very common tool using for servers simple network status. If we install CSF in any server, the traceroute  fails. So admins will think there will be some problems. As from a security view it is good to block such packets. Even though it will be good to enable the  UDP_IN port rang  33434:33523 as open in default CSF configuration.

Open csf configuration file and search for UDP_IN

Quote
# To allow incoming traceroute add 33434:33523 to this
   UDP_IN = "20,21,53,953,33434:33523"

After that restart the csf firewall on server.
Quote
# csf -r

Traceroute will work fine now  :)

8
Hello,

If you wish to set or increase Heap size in apache tomcat on cpanel server (you can see the settings that are configurable if you issue “java -X” without the quotes), then create a file named /var/cpanel/tomcat.options. Add below entries in the file:

Quote
-Xmx2000M
-Xms1000M

This would change the maximum Java heap size (Xmx) and the initial Java heap size (Xms) on startup.

After this has been done, Tomcat would need to be restarted from WHM:

Quote
Go to WHM » Restart Services » Servlet Server (Tomcat)

Once you restart tomcat it will show result as below:

Quote
Service Status
tomcat (jsvc.exec -user tomcat -cwd /usr/local/easy/share/easy-tomcat7 -pidfile /var/run/easy-tomcat7.pid -cp /usr/local/easy/bin/bootstrap.jar:/usr/local/easy/bin/tomcat-juli.jar:/usr/local/easy/share/java/commons-daemon.jar -Djava.endorsed.dirs=/usr/local/easy/share/easy-tomcat7/endorsed -outfile /var/log/easy-tomcat7/catalina.out -errfile /var/log/easy-tomcat7/catalina.err -verbose -Xmx2000M -Xms1000M org.apache.catalina.startup.Bootstrap start) running as 491 with PID 4437 (process table check method)

Startup Log
Adding in custom Tomcat option(s): -Xmx2000M
Adding in custom Tomcat option(s): -Xms1000M
Command '/usr/local/easy/bin/jsvc -user tomcat -cwd /usr/local/easy/share/easy-tomcat7 -pidfile /var/run/easy-tomcat7.pid -cp /usr/local/easy/bin/bootstrap.jar:/usr/local/easy/bin/tomcat-juli.jar:/usr/local/easy/share/java/commons-daemon.jar -Djava.endorsed.dirs=/usr/local/easy/share/easy-tomcat7/endorsed -outfile /var/log/easy-tomcat7/catalina.out -errfile /var/log/easy-tomcat7/catalina.err -verbose -Xmx2000M -Xms1000M org.apache.catalina.startup.Bootstrap start' returned: 0

tomcat started successfully.

That's all  :)

9
Errors and Solutions / Container already locked error - Openvz
« on: June 02, 2016, 04:01:33 PM »
Hello,

If you receive this message when you try to stop/start the container:
Quote
[root@server ~]# vzctl start 302
Container already locked

To fix the issue delete the lock file of the container.
Quote
[root@server ~]# rm /vz/lock/302.lck
rm: remove regular file `/vz/lock/302.lck'? y

After that start the container:
Quote
[root@server ~]# vzctl start 302
Starting container...
Container is mounted
Container start in progress...

That's it  :)


10
Tomcat Java Hosting / Service unavailable error on website
« on: May 26, 2016, 04:04:11 PM »
Hello,

One of our client was getting "Service Unavailable" error on website. Further checking it was generating below errors on the server.

Quote
INFO: validateJarFile(/home/username/public_html/WEB-INF/lib/selenium-server-standalone-2.52.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

There was compatibility issue of selenium-server-standalone-2.52.0.jar with the Tomcat server as it is a standalone server.

In order to fix issue don't use the standalone selenium jar, instead use the small non-standalone selenium jar and also use all the jars it depends on.

Download the full zip from HERE
After that Open the zip and copy selenium-java-2.53.0.jar in WEB-INF/lib folder and restart the Tomcat service.

That's it. Now your website should work fine  :)
 

11
Hi All,

You can set redirection for non-www URL to www URL in tomcat using UrlRewriteFilter. Below are the steps to set redirection:

1) Download UrlRewriteFilter to WEB-INF/lib directory of your website.

2) Go to WEB-INF/web.xml and add below code (near the top above any servlet mappings):


<filter>
    <filter-name>UrlRewriteFilter</filter-name>
    <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>UrlRewriteFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>



3) Create file urlrewrite.xml in WEB-INF and add below code:


<urlrewrite>
<rule>
              <name>Domain Name Check for example.com</name>
                <condition name="host" operator="equal">^example.com</condition>
               <from>^(.*)$</from>
               <to type="redirect">http://www.example.com$1</to>
      </rule>
</urlrewrite>



Note: Replace example.com with original domain name.

4) Restart tomcat service on the server.

That's all. Your website should now redirect from non www URL to www URL.

Pages: [1]