Apache server is installed by default on Mac. Access the configuration settings for Apache by going to
$ cd /etc/apache2/
$ vi httpd.conf
To enable php, edit httpd.conf and uncomment the line
#LoadModule php5_module libexec/apache2/libphp5.so
Uncomment other lines that you may want to load in your system. As you are enabling PHP in your system, you may want to change the DirectoryIndex to
DirectoryIndex index.php index.html
Default group/user settings inside Apache on Mac is _www:_www
$ fdisk -l /dev/sda
Device Boot Start End Blocks Id System
/dev/sda1 * 1 128 1024000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 128 383 2048000 83 Linux
Partition 2 does not end on cylinder boundary.
This is not a problem and is commonly seen in new systems. Continue Reading…
The reason why this message is shown is because the user for the view does not exist in the database.
There are few ways by which we can remove this error
i) Alter statement
ii) Create the specified user in the database
iii) Modify the .frm files related to the view and set the definer
We will show the Alter statement method to achieve the desired results
# To fix it:
mysql> ALTER DEFINER = ‘root’@’localhost’ VIEW `mytableview` AS select * from cities;
mysql> SELECT * FROM mytableview;
Sometimes it so happens that the view statement will be a big selection of fields with joins in it. Export the table first to get the required SELECT statement for the view and then change the DEFINER
In earlier systems, passwords were stored in the file /etc/passwd and they were not encrypted.
After the user is created, an entry gets recorded in /etc/passwd with ‘x’ in the second column instead of the acutal password.
$ useradd timmy
$ cat /etc/passwd
For security reasons, passwords are now stored in the file /etc/shadow and they are encrypted. Password was not set initially, when the user was created. This is indicated by !! mark (in RedHat, ! – Debian)
$ cat /etc/shadow
When we began creating an application using Struts2 framework with Hibernate and MySQL, we ran into a problem which was related to MySQL timing out its connection after a span of 8 hours when left unused. It conceived a lot of time at our end but we were able to nail down the issue at the end.
Steps that we had taken to correct the issue related to Hibernate MySql connection timeout problem are listed below
– Download Hibernate C3P0 and copy .jar files
– Set c3p0.properties
– Make changes to hibernate.cfg.xml
– Test MySQL connection timeout
– Hibernate, MySQL connection timeout related error messages
* After WAMP is installed go to the folder where the web server related PHP bin directory is present. Search for the batch file pear.bat in it. Double click the file to start the PEAR installation. Go with the defaults and complete the installation
* Search for PEAR_ENV.reg. Double click that file to register the PEAR settings as environment variable
* Go to the command prompt and type “pear list” to see what packages are installed and if PEAR is correctly installed. If PEAR cannot be accessed via the command line, it means the PATH setting is not set correctly. Environment PATH variable should include the path to where pear.bat is present
PEAR should be already installed in the system before configuring the phpseclib channel.
PHPSecLib installation is very simple.
PHPSecLib is a library of optional PHP extensions which comes in handy if the application were to be packaged as a solution for deployment to the end user.
Step 1: Register the channel
c:\> pear channel-discover phpseclib.sourceforge.net
Files created in windows when moved to linux will have ^M character at the end of lines when you open the files in Vi editor.
To remove the strange characters open the file in Vi editor and type
Linux supports many file system types like Ext2, Ext3, Ext4, NFS, FAT16, FAT32, NTFS etc. To find out what type of file systems are mounted in your system, issue the command
$ df -T
Output from the command
Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sda1 ext4 94088076 9090252 80218356 11% / udev devtmpfs 1023536 4 1023532 1% /dev
List the listening ports and check if mysql is listed on it.
$ netstat -tln | grep mysql
If you cannot find the port number for mysql view my.cnf file to see if you can find the port number. If you see a line “skip-networking” try commenting out the line and then restart mysql daemon.
$ vi /etc/my.cnf[mysqld] set-variable=local-infile=0
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
skip-networking [mysql.server] user=mysql
basedir=/var/lib [mysqld_safe] log-error=/var/log/mysqld.log
$ service mysqld restart