Home
New vdir website shell script
- Details
This is a simple script to setup a vdir and folder for Apache on Ubuntu:
First make a template file for the Apache config
First:
nano /etc/apache2/sites-available/template.conf
<VirtualHost *:80>
ServerAdmin
ServerName newsite
ServerAlias newsite
DocumentRoot /var/www/newsite/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
#save the above
Second:
nano createweb.sh
echo "Setting up website: $1"
sitename=$1
sudo mkdir /var/www/$1
sudo mkdir /var/www/$1/public_html
sudo chown -R ubuntu:ubuntu /var/www/$1/public_html
sudo cp /etc/apache2/sites-available/template.conf /etc/apache2/sites-available/$1.conf
sed -i "s/newsite/$sitename/g" /etc/apache2/sites-available/$sitename.conf
sudo a2ensite $sitename.conf
sudo chown -R www-data:www-data /var/www
sudo service apache2 restart
Third:
Now give accesss to run
chmod +x createweb.sh
Fourth:
Now test it:
./createweb.sh mylamesite.com
Office and error 80070005
- Details
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
If you need to give access for the web server to use office automation the easiest way is to just open dcom.
1. In DCOMCNFG, right click on the My Computer and select properties.
2. Choose the COM Securities tab
3. In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for <Machine_name>\Users.
4. In launch and Activation Permissions, click "Edit Defaults" and add Network Service to it and give it "Local launch" and "Local Activation" permission. Do the same for <Machine_name>\Users
You may need to add IUSR and IIS_USRS depending on your configuration
Also, you have to install office on the web server for this to even work at all.
Installing just o2010pia will do nothing for you.
If you are creating office documents within a IIS website user file permissions is going to be crucial.
I recommend creating a local user account on the web server and running your application pool under that user.
You will also want to login as that user on the web server and open the office application you plan to automate. You might get the "enter your initial" box when first opening the application and this is what is happening during automation of an office document so it errors.
You get things like
Exception message: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution
google maps API marker images
- Details
Here is a list of all the markers: https://sites.google.com/site/gmapsdevelopment/
here is how to added them to a marker
instantiate the object:
var marker = new google.maps.Marker({position: new google.maps.LatLng(lata,longi), map: map,title: "Some title", icon: 'https://maps.google.com/mapfiles/ms/micons/rangerstation.png'});
Flow and Method:
var allMarkers = [];
var marker = new google.maps.Marker({position: new google.maps.LatLng(lata,longi), map: map,title: "Some title"});
allMarkers.push(marker);
var marker = new google.maps.Marker({position: new google.maps.LatLng(lata2 ,longi2 ), map: map,title: "Some title 2"});
allMarkers.push(marker);
for(var ix=0;ix< allMarkers.length;ix++ )
{
allMarkers[ix].setIcon('https://maps.google.com/mapfiles/ms/icons/red-dot.png');
}
Install GMP on Ubuntu 14
- Details
Installing GMP should be easy:
if you need it for a PHP application then you can just do this:
apt-get install php5-gmp
nano /etc/php5/apache2/php.ini
#add the following line to the ini file
Added extension=php_gmp.so to php.ini
#save and restart apache
service apache2 restart
If you need the latest build for any other reason do this:
the first thing I do is:
cd /
mkdir downloads
cd downloads
Get the tar from here https://gmplib.org/
at the time of this article I used:
wget https://gmplib.org/download/gmp/gmp-6.0.0a.tar.lz
You will need lzip installed and dev tools
apt-get install build-essential gawk m4 gcc-multilib
apt-get install lziptar --lzip -xvf
gmp-6.0.0a.tar.lz
cd gmp-6.0.0.0
mkdir build && cd build
../configure --prefix=/usr/gcc_4_9 --build=x86_64-linux-gnu
make
make check
make install
Page 5 of 40