Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ASP.NET #1287

Merged
merged 18 commits into from
Apr 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ script:

cache:
directories:
- installs/mono-3.2.8
- installs/py2
- installs/py3
- installs/perl-5.18
4 changes: 2 additions & 2 deletions frameworks/CSharp/aspnet/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
*.suo
*/bin/*
*/obj/*
lib/*
!lib/.nuget
*/packages/*
nginx.upstream.conf
35 changes: 7 additions & 28 deletions frameworks/CSharp/aspnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
**Platforms**

* .NET Framework 4.5 (Windows)
* Mono 3.2.8 (Linux)
* Mono 3.99.0 (Linux)

**Web Servers**

Expand All @@ -29,37 +29,16 @@
**Web Stack**

* ASP.NET 4.5
* ASP.NET MVC Framework 5.1.0
* ASP.NET MVC Framework 5.2.2
* ASP.NET Razor 3.2.2

**Databases**

* MySQL Connector/Net 6.8.3
* Npgsql 2.0.14.3
* Entity Framework 6.0.2
* Mongo C# Driver 1.8.3
* MySQL Connector/Net 6.9.5
* Npgsql 2.2.3
* Entity Framework 6.1.1
* Mongo C# Driver 1.9.2

**Developer Tools**

* Visual Studio 2012

## Mono Installation

sudo apt-get install git-core build-essential autoconf automake libtool zlib1g-dev pkg-config gettext

git clone git://github.com/mono/mono
cd mono
git checkout mono-3.2.8
./autogen.sh --prefix=/usr/local
make get-monolite-latest
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe
sudo make install

cd ..

git clone git://github.com/mono/xsp
cd xsp
./autogen.sh --prefix=/usr/local
make
sudo make install

mozroots --import --sync
8 changes: 0 additions & 8 deletions frameworks/CSharp/aspnet/bash_profile.sh

This file was deleted.

Binary file removed frameworks/CSharp/aspnet/lib/.nuget/NuGet.exe
Binary file not shown.
135 changes: 0 additions & 135 deletions frameworks/CSharp/aspnet/lib/.nuget/NuGet.targets

This file was deleted.

18 changes: 17 additions & 1 deletion frameworks/CSharp/aspnet/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,23 @@ http {

location / {
fastcgi_pass mono;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you wish to clean this up a little, a number of setup.sh files are doing this

fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Expand Down
45 changes: 0 additions & 45 deletions frameworks/CSharp/aspnet/setup_nginx.py

This file was deleted.

39 changes: 23 additions & 16 deletions frameworks/CSharp/aspnet/setup_nginx.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
#!/bin/bash

set -e

# mono environment variables
. ${IROOT}/mono.installed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clever!


export NGINX_HOME=${IROOT}/nginx

sed -i 's|localhost|'"$DBHOST"'|g' src/Web.config

# build
rm -rf bin obj
cd src
$MONO_ROOT/bin/xbuild /p:Configuration=Release
# extra cleaning
rm -rf src/bin src/obj
rm -rf /tmp/nuget

xbuild src/Benchmarks.build.proj /t:Clean
xbuild src/Benchmarks.build.proj /t:Build

# one fastcgi instance for each thread
# load balanced by nginx
port_start=9001
port_end=$(($port_start+$MAX_THREADS))

# nginx
conf="upstream mono {\n"
current=9001
end=$(($current+$MAX_THREADS))
while [ $current -lt $end ]; do
conf+="\tserver 127.0.0.1:${current};\n"
let current=current+1
for port in $(seq $port_start $port_end); do
conf+="\tserver 127.0.0.1:${port};\n"
done
conf+="}"
echo -e $conf > $TROOT/nginx.upstream.conf

$NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf -g "${MAX_THREADS}"
$NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf -g "worker_processes ${MAX_THREADS};"

# Start fastcgi for each thread
# To debug, use --printlog --verbose --loglevels=All
current=9001
end=$(($current+$MAX_THREADS))
while [ $current -lt $end ]; do
MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:$(pwd)/src --socket=tcp:127.0.0.1:$current
let current=current+1
for port in $(seq $port_start $port_end); do
fastcgi-mono-server4 --applications=/:${TROOT}/src --socket=tcp:127.0.0.1:$port &
done
34 changes: 0 additions & 34 deletions frameworks/CSharp/aspnet/setup_xsp.py

This file was deleted.

Loading