Earthtracker's Blog

Just another WordPress.com weblog

Configure Virtual Host on XAMPP/WAMPP and access from another PC

This will demonstrate to configure Virtual host on windows PC and access it from another PC.

Open hosts file from \Windows\System32\drivers\etc using Notepad as Administrator

Write the following code:

127.0.0.1  xxxx.local

Note:xxxx.local your domain or subdomain name

For XAMPP:
Open httpd-vhosts.conf from xampp\apache\conf\extra

For WAMPP:
Open httpd-vhosts.conf from wamp\bin\apache\apache2.4.9\conf\extra

Write the following code :

<VirtualHost 127.0.0.1>
    ##ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:/xampp/htdocs/xxxx/"
    ServerName xxxx.local
    
    ##ErrorLog "logs/dummy-host2.example.com-error.log"
    ##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

To use the virtual host from another PC

<VirtualHost xxx.xxx.xxx.xxx:80>
    ##ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:/xampp/htdocs/xxx/"
    ServerName xxxx.local
    <Directory "/">
   # Deny from all
    Allow from  xxx.xxx.xxx.xxx
    Allow from  127.0.0.1
    </Directory>
    ##ErrorLog "logs/dummy-host2.example.com-error.log"
    ##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

Note:
xxx.xxx.xxx.xxx:80 : local pc IP and port
Allow from xxx.xxx.xxx.xxx : IP of the another PC from where you like to access the Virtual host
If you like to allow it from all , use :

    Allow from  all 

Retstart XAMPP / WAMPP

Enjoy!

Advertisements
Leave a comment »

CakePHP3 created modified not added automatically

Created / Modified should be added automatically.
if not, please check you used following behavior in Model->Table:

public function initialize(array $config)
{
$this->addBehavior(‘Timestamp’);
}

Leave a comment »

Replace url segment or folder with htaccess

If you like to replace a url segment or folder , you can follow :

https://www.example.com/loren/lipsum/blog_title
to
https://www.example.com/loren/sepcticula/blog_title

RewriteEngine On
RewriteRule ^/?loren/lipsum/(.*)$ https://www.example.com/loren/sepcticula/$1 [R=301,L]
Leave a comment »

PHP version issue when installing Craft 3 using Composer

To Ignore the PHP version warning on Craft 3 installation, need to use –ignore-platform-reqs
like

create-project -s RC craftcms/craft PATH --ignore-platform-reqs
Leave a comment »

Change Domain root to specific folder

write htaccess file on current root.

RewriteCond %{REQUEST_URI} !domain/
RewriteRule (.*) /folder/$1 [L]

Leave a comment »

শহিদ আজাদ এর মা কে নিয়ে লিখা আনিসুল হক এর মা উপন্যাস

Download Maa-Anisul-hoq

Leave a comment »

Magento 2.1.5 Assets Missing after installation

Remove everything, except .htaccess file from pub/static folder

Open up app/etc/di.xml find the path “Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink” and replace to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

Leave a comment »

Expressionengine template routes for first segment with regular expression

EE has a great tool for template routing, Developer sometimes faces problem with dynamic segment routing on first segment, then we need to use regular expression using regex. I didn’t find enough details about this on EE template routing docs. So after long hours of try, solved it.

Here is the example explained:
Club name should start with club here.

If the desired url like : domain.com/club-expresso/profile/shahed


{variable:regex[(club)]}/profile/{url_title}

Simple but very much useful!

Leave a comment »

Expressengine Assets file upload +no directory access in Channel form

Expressionengine Assets dont have any features to restrict file upload directory on channel form. So we use normal file input fields. But there is problem, it remove the selected file when next time the file is not updated.

So here the solution:
{member_photo}

<img src=”{url}” alt=”” />

<input type=”hidden” name=”member_photo” value=”{file_id}” id=”cur_file_id”>

<input type=”file” name=”member_photo” id=”file_upload”>

<input type=”hidden” name=”member_photo_filedir” value=”8″>

{/member_photo}

jQUery:
$(“#file_upload”).change(function (){ $(‘#cur_file_id’).val(”); });

Leave a comment »

Skype Crash issue on Ubuntu after upgrade

I have using older version of skype on my ubuntu 10.4, after upgrade skype version 4.3, it seems have a crash issue. So here is the solution , if you have similar problem.

Go to Your user directory Like /home/[Ubuntu user folder]/.Skype/
Usually .Skype directory is hidden.
Rename it like .Skype_temp and run skype again, It will works, and another .Skype directory will be created.

Now if you like to get the old chat history, copy the files from
/home/[Ubuntu user folder]/.Skype_temp/[Skype user account folder]/chatsync

to New .Skype Directory:

/home/[Ubuntu user folder]/.Skype/[Skype user account folder]/chatsync

This should solve the problem.

Cheers!

2 Comments »